Skip to content

Commit

Permalink
[HttpFoundation] Fix defining expiry index in PdoSessionHandler::conf…
Browse files Browse the repository at this point in the history
…igureSchema()
  • Loading branch information
nicolas-grekas committed Jan 31, 2023
1 parent a08a41c commit 1a67728
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public function configureSchema(Schema $schema, \Closure $isSameDatabase = null)
throw new \DomainException(sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver));
}
$table->setPrimaryKey([$this->idCol]);
$table->addIndex([$this->lifetimeCol], $this->lifetimeCol.'_idx');
}

/**
Expand Down Expand Up @@ -259,7 +260,7 @@ public function createTable()

try {
$this->pdo->exec($sql);
$this->pdo->exec("CREATE INDEX expiry ON $this->table ($this->lifetimeCol)");
$this->pdo->exec("CREATE INDEX {$this->lifetimeCol}_idx ON $this->table ($this->lifetimeCol)");
} catch (\PDOException $e) {
$this->rollback();

Expand Down

0 comments on commit 1a67728

Please sign in to comment.