vendor/bluue/stocks-bundle/migrations/Version20240624112039.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace StocksBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20240624112039 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE stocks_bundle__warehouse ADD default_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD default_sub_location_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  11.         $this->addSql('ALTER TABLE stocks_bundle__warehouse ADD CONSTRAINT FK_CDFD4A43D2BE3238 FOREIGN KEY (default_location_id) REFERENCES stocks_bundle__location (id)');
  12.         $this->addSql('ALTER TABLE stocks_bundle__warehouse ADD CONSTRAINT FK_CDFD4A437BE2FCCC FOREIGN KEY (default_sub_location_id) REFERENCES stocks_bundle__sub_location (id)');
  13.         $this->addSql('CREATE INDEX IDX_CDFD4A43D2BE3238 ON stocks_bundle__warehouse (default_location_id)');
  14.         $this->addSql('CREATE INDEX IDX_CDFD4A437BE2FCCC ON stocks_bundle__warehouse (default_sub_location_id)');
  15.     }
  16.     public function down(Schema $schema): void
  17.     {
  18.         $this->addSql('ALTER TABLE stocks_bundle__warehouse DROP FOREIGN KEY FK_CDFD4A43D2BE3238');
  19.         $this->addSql('ALTER TABLE stocks_bundle__warehouse DROP FOREIGN KEY FK_CDFD4A437BE2FCCC');
  20.         $this->addSql('DROP INDEX IDX_CDFD4A43D2BE3238 ON stocks_bundle__warehouse');
  21.         $this->addSql('DROP INDEX IDX_CDFD4A437BE2FCCC ON stocks_bundle__warehouse');
  22.         $this->addSql('ALTER TABLE stocks_bundle__warehouse DROP default_location_id, DROP default_sub_location_id');
  23.     }
  24. }