migrations/Version20261105171539.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20261105171539 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 tiktok_account (id INT AUTO_INCREMENT NOT NULL, social_media_id INT NOT NULL, username VARCHAR(255) DEFAULT NULL, access_token_encrypted LONGTEXT DEFAULT NULL, refresh_token_encrypted LONGTEXT NOT NULL, access_token_expires_at DATETIME DEFAULT NULL, scope LONGTEXT DEFAULT NULL, revoked TINYINT(1) NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_2EA3546C64AE4959 (social_media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE tiktok_account ADD CONSTRAINT FK_2EA3546C64AE4959 FOREIGN KEY (social_media_id) REFERENCES social_media (id) ON DELETE CASCADE');$this->addSql('ALTER TABLE post_record CHANGE raw_metrics raw_metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE metrics metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\'');$this->addSql('ALTER TABLE record_social_media CHANGE raw_metrics raw_metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE metrics metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\'');$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE tiktok_account DROP FOREIGN KEY FK_2EA3546C64AE4959');$this->addSql('DROP TABLE tiktok_account');$this->addSql('ALTER TABLE post_record CHANGE raw_metrics raw_metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE metrics metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\'');$this->addSql('ALTER TABLE record_social_media CHANGE raw_metrics raw_metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE metrics metrics JSON DEFAULT NULL COMMENT \'(DC2Type:json)\'');$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');}}