migrations/Version20230416181559.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20230416181559 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B76D21890 FOREIGN KEY (nft_contract_id) REFERENCES nft_contract (id)');
  20.         $this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B311942E6 FOREIGN KEY (market_contract_id) REFERENCES nft_contract (id)');
  21.         $this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384B23E0638D FOREIGN KEY (nft_hub_id) REFERENCES nft_hub (id)');
  22.         $this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384BBE40AFAE FOREIGN KEY (bidder_id) REFERENCES theta_wallet (id)');
  23.         $this->addSql('ALTER TABLE market_offer ADD CONSTRAINT FK_E2F8384BA184CB42 FOREIGN KEY (market_sale_payout_id) REFERENCES market_sale_payout (id)');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B76D21890');
  29.         $this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B311942E6');
  30.         $this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384B23E0638D');
  31.         $this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384BBE40AFAE');
  32.         $this->addSql('ALTER TABLE market_offer DROP FOREIGN KEY FK_E2F8384BA184CB42');
  33.         $this->addSql('DROP TABLE market_offer');
  34.     }
  35. }