migrations/Version20210326173013.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. final class Version20210326173013 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         // this up() migration is auto-generated, please modify it to your needs
  11.         $this->addSql('ALTER TABLE lot ADD origin_id INT DEFAULT NULL');
  12.         $this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291B56A273CC FOREIGN KEY (origin_id) REFERENCES dealer (id)');
  13.         $this->addSql('CREATE INDEX IDX_B81291B56A273CC ON lot (origin_id)');
  14.     }
  15.     public function down(Schema $schema): void
  16.     {
  17.         // this down() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE lot DROP FOREIGN KEY FK_B81291B56A273CC');
  19.         $this->addSql('DROP INDEX IDX_B81291B56A273CC ON lot');
  20.         $this->addSql('ALTER TABLE lot DROP origin_id');
  21.     }
  22. }