Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c24cf10

Browse files
bug #49172 [HttpFoundation] Fix defining expiry index in PdoSessionHandler::configureSchema() (nicolas-grekas)
This PR was merged into the 6.3 branch. Discussion ---------- [HttpFoundation] Fix defining expiry index in PdoSessionHandler::configureSchema() | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Forgotten in #48059 Commits ------- 1a67728 [HttpFoundation] Fix defining expiry index in PdoSessionHandler::configureSchema()
2 parents 22a2729 + 1a67728 commit c24cf10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/HttpFoundation/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)