migrations/Version20230213012150.php line 1
<?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 Version20230213012150 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE market_item ADD market_sale_payout_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE market_item ADD CONSTRAINT FK_5017DCAEA184CB42 FOREIGN KEY (market_sale_payout_id) REFERENCES market_sale_payout (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_5017DCAEA184CB42 ON market_item (market_sale_payout_id)');
$this->addSql('ALTER TABLE market_sale_payout DROP FOREIGN KEY FK_2E2005DB1BF9BADE');
$this->addSql('DROP INDEX UNIQ_2E2005DB1BF9BADE ON market_sale_payout');
$this->addSql('ALTER TABLE market_sale_payout DROP market_item_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE market_item DROP FOREIGN KEY FK_5017DCAEA184CB42');
$this->addSql('DROP INDEX UNIQ_5017DCAEA184CB42 ON market_item');
$this->addSql('ALTER TABLE market_item DROP market_sale_payout_id');
$this->addSql('ALTER TABLE market_sale_payout ADD market_item_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE market_sale_payout ADD CONSTRAINT FK_2E2005DB1BF9BADE FOREIGN KEY (market_item_id) REFERENCES market_item (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2E2005DB1BF9BADE ON market_sale_payout (market_item_id)');
}
}