migrations/Version20230427124942.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 Version20230427124942 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 DROP FOREIGN KEY FK_5017DCAEA184CB42');
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384BA184CB42');
$this->addSql('ALTER TABLE market_payout DROP FOREIGN KEY FK_6E8A020E1BF9BADE');
$this->addSql('ALTER TABLE market_payout DROP FOREIGN KEY FK_6E8A020E712520F3');
$this->addSql('ALTER TABLE market_payout DROP FOREIGN KEY FK_6E8A020EBE776126');
$this->addSql('ALTER TABLE market_sale_payout DROP FOREIGN KEY FK_2E2005DB712520F3');
$this->addSql('DROP TABLE market_payout');
$this->addSql('DROP TABLE market_sale_payout');
$this->addSql('DROP INDEX UNIQ_5017DCAEA184CB42 ON market_item');
$this->addSql('ALTER TABLE market_item ADD seller_payout NUMERIC(36, 18) DEFAULT NULL, ADD fee NUMERIC(36, 18) DEFAULT NULL, DROP market_sale_payout_id');
$this->addSql('DROP INDEX UNIQ_E2F8384BA184CB42 ON market_offer');
$this->addSql('ALTER TABLE market_offer ADD seller_payout NUMERIC(36, 18) DEFAULT NULL, ADD fee NUMERIC(36, 18) DEFAULT NULL, CHANGE market_sale_payout_id seller_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B8DE820D9 FOREIGN KEY (seller_id) REFERENCES theta_wallet (id)');
$this->addSql('CREATE INDEX IDX_E2F8384B8DE820D9 ON market_offer (seller_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE market_payout (id INT AUTO_INCREMENT NOT NULL, market_item_id INT DEFAULT NULL, market_offer_id INT DEFAULT NULL, wallet_id INT NOT NULL, payout NUMERIC(36, 18) NOT NULL, fee NUMERIC(36, 18) NOT NULL, tx VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX UNIQ_6E8A020E1BF9BADE (market_item_id), UNIQUE INDEX UNIQ_6E8A020EBE776126 (market_offer_id), INDEX IDX_6E8A020E712520F3 (wallet_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE market_sale_payout (id INT AUTO_INCREMENT NOT NULL, wallet_id INT NOT NULL, sale_fee NUMERIC(36, 18) NOT NULL, sale_payout NUMERIC(36, 18) NOT NULL, INDEX IDX_2E2005DB712520F3 (wallet_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE market_payout ADD CONSTRAINT FK_6E8A020E1BF9BADE FOREIGN KEY (market_item_id) REFERENCES market_item (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE market_payout ADD CONSTRAINT FK_6E8A020E712520F3 FOREIGN KEY (wallet_id) REFERENCES theta_wallet (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE market_payout ADD CONSTRAINT FK_6E8A020EBE776126 FOREIGN KEY (market_offer_id) REFERENCES market_offer (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE market_sale_payout ADD CONSTRAINT FK_2E2005DB712520F3 FOREIGN KEY (wallet_id) REFERENCES theta_wallet (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE market_item ADD market_sale_payout_id INT DEFAULT NULL, DROP seller_payout, DROP fee');
$this->addSql('ALTER TABLE market_item ADD CONSTRAINT FK_5017DCAEA184CB42 FOREIGN KEY (market_sale_payout_id) REFERENCES market_sale_payout (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_5017DCAEA184CB42 ON market_item (market_sale_payout_id)');
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B8DE820D9');
$this->addSql('DROP INDEX IDX_E2F8384B8DE820D9 ON market_offer');
$this->addSql('ALTER TABLE market_offer DROP seller_payout, DROP fee, CHANGE seller_id market_sale_payout_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384BA184CB42 FOREIGN KEY (market_sale_payout_id) REFERENCES market_sale_payout (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_E2F8384BA184CB42 ON market_offer (market_sale_payout_id)');
}
}