Skip to content

Commit

Permalink
bug #49172 [HttpFoundation] Fix defining expiry index in PdoSessionHa…
Browse files Browse the repository at this point in the history
…ndler::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()
  • Loading branch information
nicolas-grekas committed Feb 1, 2023
2 parents 22a2729 + 1a67728 commit c24cf10
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 c24cf10

Please sign in to comment.