<?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 Version20230124135342 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create table to save auto bid history';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE auction_auto_bid_history (id INT AUTO_INCREMENT NOT NULL, auction_auto_bid_id INT NOT NULL, object_customer_id INT NOT NULL, auction_id VARCHAR(255) NOT NULL, object_id INT NOT NULL, value NUMERIC(19, 2) NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_DFB658941723A8FD (auction_auto_bid_id), INDEX IDX_DFB784705131A3FD (object_customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE auction_auto_bid_history ADD CONSTRAINT FK_DFB568455871A3FD FOREIGN KEY (auction_auto_bid_id) REFERENCES auction_auto_bid (id)');
$this->addSql('ALTER TABLE auction_auto_bid_history ADD CONSTRAINT FK_DFB278954635A4FD FOREIGN KEY (object_customer_id) REFERENCES object_customer (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE auction_auto_bid_history');
}
}