<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220715195111 extends AbstractMigration
{
public function getDescription(): string
{
return 'Added bid_id column to object_avanti_log table';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE object_avanti_log ADD bid_id INT AFTER sales_price');
$this->addSql('ALTER TABLE object_avanti_log ADD CONSTRAINT FK_DC0778E607FBD82 FOREIGN KEY (bid_id) REFERENCES auction_bid (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_DC0778E607FBD82 ON object_avanti_log (bid_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE object_avanti_log DROP FOREIGN KEY FK_DC0778E607FBD82');
$this->addSql('DROP INDEX UNIQ_DC0778E607FBD82 ON object_avanti_log');
$this->addSql('ALTER TABLE object_avanti_log DROP bid_id');
}
}