<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20210326173013 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE lot ADD origin_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291B56A273CC FOREIGN KEY (origin_id) REFERENCES dealer (id)');
$this->addSql('CREATE INDEX IDX_B81291B56A273CC ON lot (origin_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE lot DROP FOREIGN KEY FK_B81291B56A273CC');
$this->addSql('DROP INDEX IDX_B81291B56A273CC ON lot');
$this->addSql('ALTER TABLE lot DROP origin_id');
}
}