<?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 Version20211201123242 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update auction_bid columns, added new column to customer_id';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE auction_bid ADD object_customer_id INT DEFAULT NULL, DROP user_id');
$this->addSql('ALTER TABLE auction_bid ADD CONSTRAINT FK_401A9C435131A3FD FOREIGN KEY (object_customer_id) REFERENCES object_customer (id)');
$this->addSql('CREATE INDEX IDX_401A9C435131A3FD ON auction_bid (object_customer_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE auction_bid DROP FOREIGN KEY FK_401A9C435131A3FD');
$this->addSql('DROP INDEX IDX_401A9C435131A3FD ON auction_bid');
$this->addSql('ALTER TABLE auction_bid ADD user_id INT NOT NULL, DROP object_customer_id');
}
}