<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220202213018 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE payment ADD auction_id INT DEFAULT NULL, ADD client_id INT DEFAULT NULL, ADD status INT NOT NULL, ADD debit INT NOT NULL, ADD notes LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE payment ADD CONSTRAINT FK_6D28840D57B8F0DE FOREIGN KEY (auction_id) REFERENCES auction (id)');
$this->addSql('ALTER TABLE payment ADD CONSTRAINT FK_6D28840D19EB6921 FOREIGN KEY (client_id) REFERENCES client (id)');
$this->addSql('CREATE INDEX IDX_6D28840D57B8F0DE ON payment (auction_id)');
$this->addSql('CREATE INDEX IDX_6D28840D19EB6921 ON payment (client_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE payment DROP FOREIGN KEY FK_6D28840D57B8F0DE');
$this->addSql('ALTER TABLE payment DROP FOREIGN KEY FK_6D28840D19EB6921');
$this->addSql('DROP INDEX IDX_6D28840D57B8F0DE ON payment');
$this->addSql('DROP INDEX IDX_6D28840D19EB6921 ON payment');
$this->addSql('ALTER TABLE payment DROP auction_id, DROP client_id, DROP status, DROP debit, DROP notes');
}
}