Skip to content

Commit a579c07

Browse files
[HttpFoundation] Fix defining expiry index in PdoSessionHandler::configureSchema()
1 parent fad43be commit a579c07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ public function configureSchema(Schema $schema, \Closure $isSameDatabase = null)
225225
throw new \DomainException(sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver));
226226
}
227227
$table->setPrimaryKey([$this->idCol]);
228+
$table->addIndex([$this->lifetimeCol], $this->lifetimeCol.'_idx');
228229
}
229230

230231
/**
@@ -259,7 +260,7 @@ public function createTable()
259260

260261
try {
261262
$this->pdo->exec($sql);
262-
$this->pdo->exec("CREATE INDEX expiry ON $this->table ($this->lifetimeCol)");
263+
$this->pdo->exec("CREATE INDEX {$this->lifetimeCol}_idx ON $this->table ($this->lifetimeCol)");
263264
} catch (\PDOException $e) {
264265
$this->rollback();
265266

0 commit comments

Comments
 (0)