migrations/Version20260820213051.php line 1

  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 Version20260820213051 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('CREATE TABLE twitter_account (id INT AUTO_INCREMENT NOT NULL, social_media_id INT NOT NULL, x_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_B147A23664AE4959 (social_media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE twitter_account ADD CONSTRAINT FK_B147A23664AE4959 FOREIGN KEY (social_media_id) REFERENCES social_media (id)');
  20.         $this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('ALTER TABLE twitter_account DROP FOREIGN KEY FK_B147A23664AE4959');
  26.         $this->addSql('DROP TABLE twitter_account');
  27.         $this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
  28.     }
  29. }