<?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 Version20220216153137 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update in auction bid table';
}
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 from_autobid INT DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE auction_bid ADD date DATETIME(6) NOT NULL');
$this->addSql('DROP INDEX bid_object_user_value_unique ON auction_bid');
$this->addSql('CREATE UNIQUE INDEX bid_object_user_value_unique ON auction_bid (auction_id, object_id, value, 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 from_autobid');
$this->addSql('ALTER TABLE auction_bid DROP date');
$this->addSql('DROP INDEX bid_object_user_value_unique ON auction_bid');
$this->addSql('CREATE UNIQUE INDEX bid_object_user_value_unique ON auction_bid (auction_id, object_id, value)');
}
}