migrations/Version20220611195544.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 Version20220611195544 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE lot DROP FOREIGN KEY FK_B81291B56A273CC');
  11.         $this->addSql('DROP INDEX IDX_B81291B56A273CC ON lot');
  12.         $this->addSql('ALTER TABLE lot ADD origin VARCHAR(255) DEFAULT NULL, DROP origin_id');
  13.     }
  14.     public function down(Schema $schema): void
  15.     {
  16.         $this->addSql('ALTER TABLE lot ADD origin_id INT DEFAULT NULL, DROP origin');
  17.         $this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291B56A273CC FOREIGN KEY (origin_id) REFERENCES dealer (id)');
  18.         $this->addSql('CREATE INDEX IDX_B81291B56A273CC ON lot (origin_id)');
  19.     }
  20. }