<?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 Version20220405203001 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('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095AA76ED395');
$this->addSql('DROP INDEX IDX_AC74095AA76ED395 ON activity');
$this->addSql('DROP INDEX user_id__campaign_id ON activity');
$this->addSql('ALTER TABLE activity CHANGE user_id creator_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095A61220EA6 FOREIGN KEY (creator_id) REFERENCES creator (id)');
$this->addSql('CREATE INDEX IDX_AC74095A61220EA6 ON activity (creator_id)');
$this->addSql('CREATE UNIQUE INDEX unique_activity ON activity (creator_id, campaign_id)');
$this->addSql('ALTER TABLE creator DROP updated_at, CHANGE last_notifications last_notifications JSON DEFAULT (JSON_ARRAY()) NOT NULL');
$this->addSql('ALTER TABLE tik_tok_auth CHANGE refreshed_at refreshed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE waitlist CHANGE auth_state auth_state BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095A61220EA6');
$this->addSql('DROP INDEX IDX_AC74095A61220EA6 ON activity');
$this->addSql('DROP INDEX unique_activity ON activity');
$this->addSql('ALTER TABLE activity CHANGE creator_id user_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_AC74095AA76ED395 ON activity (user_id)');
$this->addSql('CREATE UNIQUE INDEX user_id__campaign_id ON activity (user_id, campaign_id)');
$this->addSql('ALTER TABLE creator ADD updated_at DATETIME NOT NULL, CHANGE last_notifications last_notifications JSON DEFAULT \'json_object()\' NOT NULL');
$this->addSql('ALTER TABLE tik_tok_auth CHANGE refreshed_at refreshed_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE waitlist CHANGE auth_state auth_state BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:ulid)\'');
}
public function isTransactional(): bool
{
return false;
}
}