<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260609120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add sessions table for the DB-backed PdoSessionHandler (shared sessions across Fargate tasks).';
}
public function up(Schema $schema): void
{
// Symfony PdoSessionHandler default schema (MySQL). utf8mb4_bin so session ids are matched
// byte-exactly; BLOB for binary-serialised session payloads.
$this->addSql('CREATE TABLE sessions (
sess_id VARBINARY(128) NOT NULL PRIMARY KEY,
sess_data BLOB NOT NULL,
sess_lifetime INT UNSIGNED NOT NULL,
sess_time INT UNSIGNED NOT NULL,
INDEX sessions_sess_lifetime_idx (sess_lifetime)
) COLLATE utf8mb4_bin, ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE sessions');
}
}