migrations/Version20220927080456.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220927080456 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE price_map ADD sustainability_option_id INT DEFAULT NULL, ADD packaging_type_id INT DEFAULT NULL, ADD pouch_type_id INT DEFAULT NULL, ADD material_variation_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE price_map ADD CONSTRAINT FK_C6C1A134D2BD542F FOREIGN KEY (sustainability_option_id) REFERENCES sustainability_option (id)');
  20.         $this->addSql('ALTER TABLE price_map ADD CONSTRAINT FK_C6C1A1342DE8FC4E FOREIGN KEY (packaging_type_id) REFERENCES packaging_type (id)');
  21.         $this->addSql('ALTER TABLE price_map ADD CONSTRAINT FK_C6C1A134697E1986 FOREIGN KEY (pouch_type_id) REFERENCES pouch (id)');
  22.         $this->addSql('ALTER TABLE price_map ADD CONSTRAINT FK_C6C1A1345FFA2BD8 FOREIGN KEY (material_variation_id) REFERENCES material_variation (id)');
  23.         $this->addSql('CREATE INDEX IDX_C6C1A134D2BD542F ON price_map (sustainability_option_id)');
  24.         $this->addSql('CREATE INDEX IDX_C6C1A1342DE8FC4E ON price_map (packaging_type_id)');
  25.         $this->addSql('CREATE INDEX IDX_C6C1A134697E1986 ON price_map (pouch_type_id)');
  26.         $this->addSql('CREATE INDEX IDX_C6C1A1345FFA2BD8 ON price_map (material_variation_id)');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql('ALTER TABLE price_map DROP FOREIGN KEY FK_C6C1A134D2BD542F');
  32.         $this->addSql('ALTER TABLE price_map DROP FOREIGN KEY FK_C6C1A1342DE8FC4E');
  33.         $this->addSql('ALTER TABLE price_map DROP FOREIGN KEY FK_C6C1A134697E1986');
  34.         $this->addSql('ALTER TABLE price_map DROP FOREIGN KEY FK_C6C1A1345FFA2BD8');
  35.         $this->addSql('DROP INDEX IDX_C6C1A134D2BD542F ON price_map');
  36.         $this->addSql('DROP INDEX IDX_C6C1A1342DE8FC4E ON price_map');
  37.         $this->addSql('DROP INDEX IDX_C6C1A134697E1986 ON price_map');
  38.         $this->addSql('DROP INDEX IDX_C6C1A1345FFA2BD8 ON price_map');
  39.         $this->addSql('ALTER TABLE price_map DROP sustainability_option_id, DROP packaging_type_id, DROP pouch_type_id, DROP material_variation_id');
  40.     }
  41. }