migrations/Version20260611213000.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20260611213000 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'sessions.sess_data BLOB -> MEDIUMBLOB: serialized manager sessions exceed 64KB and '
  11.             'MySQL (sql_mode without STRICT_TRANS_TABLES) silently truncates them, so the next read '
  12.             'fails to decode and the user is signed out. MEDIUMBLOB matches the DDL Symfony\'s '
  13.             'PdoSessionHandler::createTable() emits for MySQL.';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('ALTER TABLE sessions CHANGE sess_data sess_data MEDIUMBLOB NOT NULL');
  18.     }
  19.     public function down(Schema $schema): void
  20.     {
  21.         $this->addSql('ALTER TABLE sessions CHANGE sess_data sess_data BLOB NOT NULL');
  22.     }
  23. }