<?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 Version20250119183414 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 youtube_auth (id VARCHAR(255) NOT NULL, channel_id VARCHAR(255) DEFAULT NULL, access_token VARCHAR(255) NOT NULL, refresh_token VARCHAR(255) NOT NULL, scope LONGTEXT NOT NULL, token_type VARCHAR(255) NOT NULL, expired_in INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_7F4CA87F72F5A1AA (channel_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE creator ADD youtube_auth_id VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE creator ADD CONSTRAINT FK_BC06EA638082819C FOREIGN KEY (youtube_auth_id) REFERENCES youtube_auth (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_BC06EA632058D178 ON creator (youtube_auth_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE creator DROP FOREIGN KEY FK_BC06EA632058D178');
$this->addSql('DROP TABLE youtube_auth');
$this->addSql('DROP INDEX UNIQ_BC06EA632058D178 ON creator');
$this->addSql('ALTER TABLE creator DROP youtube_auth_id');
}
}