migrations/Version20230426195047.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 Version20230426195047 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('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 DOUBLE PRECISION NOT NULL, fee DOUBLE PRECISION NOT NULL, 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');
$this->addSql('CREATE TABLE withdrawal_log (id INT AUTO_INCREMENT NOT NULL, wallet_id INT NOT NULL, amount DOUBLE PRECISION NOT NULL, withdrawn_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', tx VARCHAR(255) NOT NULL, INDEX IDX_5589944B712520F3 (wallet_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE market_payout ADD CONSTRAINT FK_6E8A020E1BF9BADE FOREIGN KEY (market_item_id) REFERENCES market_item (id)');
$this->addSql('ALTER TABLE market_payout ADD CONSTRAINT FK_6E8A020EBE776126 FOREIGN KEY (market_offer_id) REFERENCES market_offer (id)');
$this->addSql('ALTER TABLE market_payout ADD CONSTRAINT FK_6E8A020E712520F3 FOREIGN KEY (wallet_id) REFERENCES theta_wallet (id)');
$this->addSql('ALTER TABLE withdrawal_log ADD CONSTRAINT FK_5589944B712520F3 FOREIGN KEY (wallet_id) REFERENCES theta_wallet (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE market_payout DROP FOREIGN KEY FK_6E8A020E1BF9BADE');
$this->addSql('ALTER TABLE market_payout DROP FOREIGN KEY FK_6E8A020EBE776126');
$this->addSql('ALTER TABLE market_payout DROP FOREIGN KEY FK_6E8A020E712520F3');
$this->addSql('ALTER TABLE withdrawal_log DROP FOREIGN KEY FK_5589944B712520F3');
$this->addSql('DROP TABLE market_payout');
$this->addSql('DROP TABLE withdrawal_log');
}
}