migrations/Version20211201093243.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 Version20211201093243 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 order_movement DROP FOREIGN KEY FK_15257746E23FC673');
  19.         $this->addSql('ALTER TABLE order_movement DROP FOREIGN KEY FK_15257746A73F0E34');
  20.         $this->addSql('DROP TABLE cooking_category');
  21.         $this->addSql('DROP TABLE cut_category');
  22.         $this->addSql('DROP TABLE destination_service');
  23.         $this->addSql('DROP INDEX IDX_15257746E23FC673 ON order_movement');
  24.         $this->addSql('DROP INDEX IDX_15257746A73F0E34 ON order_movement');
  25.         $this->addSql('ALTER TABLE order_movement DROP cut_category_id, DROP cooking_category_id, DROP first_reduction, DROP second_reduction');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('CREATE TABLE cooking_category (id INT AUTO_INCREMENT NOT NULL, name_fr VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_en VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_de VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_nl VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  31.         $this->addSql('CREATE TABLE cut_category (id INT AUTO_INCREMENT NOT NULL, name_fr VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_en VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_de VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_nl VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  32.         $this->addSql('CREATE TABLE destination_service (id INT AUTO_INCREMENT NOT NULL, name_fr VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_en VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_de VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name_nl VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  33.         $this->addSql('ALTER TABLE order_movement ADD cut_category_id INT DEFAULT NULL, ADD cooking_category_id INT DEFAULT NULL, ADD first_reduction LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\', ADD second_reduction LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:array)\'');
  34.         $this->addSql('ALTER TABLE order_movement ADD CONSTRAINT FK_15257746A73F0E34 FOREIGN KEY (cut_category_id) REFERENCES cut_category (id)');
  35.         $this->addSql('ALTER TABLE order_movement ADD CONSTRAINT FK_15257746E23FC673 FOREIGN KEY (cooking_category_id) REFERENCES cooking_category (id)');
  36.         $this->addSql('CREATE INDEX IDX_15257746E23FC673 ON order_movement (cooking_category_id)');
  37.         $this->addSql('CREATE INDEX IDX_15257746A73F0E34 ON order_movement (cut_category_id)');
  38.     }
  39. }