migrations/Version20220405203001.php line 1

Open in your IDE?
  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 Version20220405203001 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('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095AA76ED395');
  19.         $this->addSql('DROP INDEX IDX_AC74095AA76ED395 ON activity');
  20.         $this->addSql('DROP INDEX user_id__campaign_id ON activity');
  21.         $this->addSql('ALTER TABLE activity CHANGE user_id creator_id BIGINT UNSIGNED DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095A61220EA6 FOREIGN KEY (creator_id) REFERENCES creator (id)');
  23.         $this->addSql('CREATE INDEX IDX_AC74095A61220EA6 ON activity (creator_id)');
  24.         $this->addSql('CREATE UNIQUE INDEX unique_activity ON activity (creator_id, campaign_id)');
  25.         $this->addSql('ALTER TABLE creator DROP updated_at, CHANGE last_notifications last_notifications JSON DEFAULT (JSON_ARRAY()) NOT NULL');
  26.         $this->addSql('ALTER TABLE tik_tok_auth CHANGE refreshed_at refreshed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL');
  27.         $this->addSql('ALTER TABLE waitlist CHANGE auth_state auth_state BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('ALTER TABLE activity DROP FOREIGN KEY FK_AC74095A61220EA6');
  33.         $this->addSql('DROP INDEX IDX_AC74095A61220EA6 ON activity');
  34.         $this->addSql('DROP INDEX unique_activity ON activity');
  35.         $this->addSql('ALTER TABLE activity CHANGE creator_id user_id BIGINT UNSIGNED DEFAULT NULL');
  36.         $this->addSql('ALTER TABLE activity ADD CONSTRAINT FK_AC74095AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
  37.         $this->addSql('CREATE INDEX IDX_AC74095AA76ED395 ON activity (user_id)');
  38.         $this->addSql('CREATE UNIQUE INDEX user_id__campaign_id ON activity (user_id, campaign_id)');
  39.         $this->addSql('ALTER TABLE creator ADD updated_at DATETIME NOT NULL, CHANGE last_notifications last_notifications JSON DEFAULT \'json_object()\' NOT NULL');
  40.         $this->addSql('ALTER TABLE tik_tok_auth CHANGE refreshed_at refreshed_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
  41.         $this->addSql('ALTER TABLE waitlist CHANGE auth_state auth_state BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:ulid)\'');
  42.     }
  43.     public function isTransactional(): bool
  44.     {
  45.         return false;
  46.     }
  47. }