migrations/Version20220701111559.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 Version20220701111559 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` DROP FOREIGN KEY FK_F529939877E5854A');
  19.         $this->addSql('DROP INDEX IDX_F529939877E5854A ON `order`');
  20.         $this->addSql('ALTER TABLE `order` ADD updated_at DATETIME NOT NULL, DROP mode_id, DROP edited_at, CHANGE created_at created_at DATETIME NOT NULL');
  21.         $this->addSql('ALTER TABLE order_item ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL, DROP create_at, DROP edited_at');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('ALTER TABLE `order` ADD mode_id INT NOT NULL, ADD edited_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP updated_at, CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
  27.         $this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F529939877E5854A FOREIGN KEY (mode_id) REFERENCES mode (id)');
  28.         $this->addSql('CREATE INDEX IDX_F529939877E5854A ON `order` (mode_id)');
  29.         $this->addSql('ALTER TABLE order_item ADD create_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD edited_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP created_at, DROP updated_at');
  30.     }
  31. }