<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260617120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'A5/A6: add tik_tok_auth.access_token_expires_at (drive the lazy refresh off the 24h '
. 'access-token expiry, not a 1h timer) and drop ON UPDATE CURRENT_TIMESTAMP from '
. 'refreshed_at (so it advances only on a successful token exchange, not any row write).';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE tik_tok_auth ADD access_token_expires_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE tik_tok_auth CHANGE refreshed_at refreshed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE tik_tok_auth DROP access_token_expires_at');
$this->addSql('ALTER TABLE tik_tok_auth CHANGE refreshed_at refreshed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL');
}
}