migrations/Version20230515184225.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 Version20230515184225 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 crate_action_log (id INT AUTO_INCREMENT NOT NULL, received_by_id INT DEFAULT NULL, opened_by_id INT DEFAULT NULL, received_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', received_tx VARCHAR(255) DEFAULT NULL, initiate_open_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', is_opened TINYINT(1) DEFAULT NULL, opened_tx VARCHAR(255) DEFAULT NULL, INDEX IDX_338FCD596F8DDD17 (received_by_id), INDEX IDX_338FCD59AB159F5 (opened_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE crate_action_log ADD CONSTRAINT FK_338FCD596F8DDD17 FOREIGN KEY (received_by_id) REFERENCES theta_wallet (id)');
$this->addSql('ALTER TABLE crate_action_log ADD CONSTRAINT FK_338FCD59AB159F5 FOREIGN KEY (opened_by_id) REFERENCES theta_wallet (id)');
$this->addSql('ALTER TABLE nft_hub ADD crate_action_log_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE nft_hub ADD CONSTRAINT FK_B0444A2567FE78E FOREIGN KEY (crate_action_log_id) REFERENCES crate_action_log (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B0444A2567FE78E ON nft_hub (crate_action_log_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE nft_hub DROP FOREIGN KEY FK_B0444A2567FE78E');
$this->addSql('ALTER TABLE crate_action_log DROP FOREIGN KEY FK_338FCD596F8DDD17');
$this->addSql('ALTER TABLE crate_action_log DROP FOREIGN KEY FK_338FCD59AB159F5');
$this->addSql('DROP TABLE crate_action_log');
$this->addSql('DROP INDEX UNIQ_B0444A2567FE78E ON nft_hub');
$this->addSql('ALTER TABLE nft_hub DROP crate_action_log_id');
}
}