migrations/Version20230416181559.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 Version20230416181559 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_offer (id INT AUTO_INCREMENT NOT NULL, nft_contract_id INT NOT NULL, market_contract_id INT NOT NULL, nft_hub_id INT NOT NULL, bidder_id INT NOT NULL, market_sale_payout_id INT DEFAULT NULL, offer_id INT NOT NULL, price NUMERIC(36, 18) NOT NULL, is_accepted TINYINT(1) DEFAULT NULL, is_canceled TINYINT(1) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', notification_read TINYINT(1) DEFAULT NULL, INDEX IDX_E2F8384B76D21890 (nft_contract_id), INDEX IDX_E2F8384B311942E6 (market_contract_id), INDEX IDX_E2F8384B23E0638D (nft_hub_id), INDEX IDX_E2F8384BBE40AFAE (bidder_id), UNIQUE INDEX UNIQ_E2F8384BA184CB42 (market_sale_payout_id), UNIQUE INDEX market_contract_offer_id (offer_id, market_contract_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B76D21890 FOREIGN KEY (nft_contract_id) REFERENCES nft_contract (id)');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B311942E6 FOREIGN KEY (market_contract_id) REFERENCES nft_contract (id)');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B23E0638D FOREIGN KEY (nft_hub_id) REFERENCES nft_hub (id)');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384BBE40AFAE FOREIGN KEY (bidder_id) REFERENCES theta_wallet (id)');
$this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384BA184CB42 FOREIGN KEY (market_sale_payout_id) REFERENCES market_sale_payout (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B76D21890');
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B311942E6');
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B23E0638D');
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384BBE40AFAE');
$this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384BA184CB42');
$this->addSql('DROP TABLE market_offer');
}
}