migrations/Version20230414131941.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 Version20230414131941 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('SET foreign_key_checks = 0');
$this->addSql('ALTER TABLE market_item ADD market_contract_id INT NOT NULL NULL');
$this->addSql('ALTER TABLE market_item ADD CONSTRAINT FK_5017DCAE311942E6 FOREIGN KEY (market_contract_id) REFERENCES nft_contract (id)');
$this->addSql('CREATE INDEX IDX_5017DCAE311942E6 ON market_item (market_contract_id)');
$this->addSql('SET foreign_key_checks = 1');
}
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_5017DCAE311942E6');
$this->addSql('DROP INDEX IDX_5017DCAE311942E6 ON market_item');
$this->addSql('ALTER TABLE market_item CHANGE market_contract_id market_contract_id INT DEFAULT NULL');
}
}