diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-12-12 13:34:06 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-12-12 13:34:06 +0100 |
commit | 2e9747a59a6011622588829e4605af3710b61a21 (patch) | |
tree | e32ad4a7029ed3e32ef05f11eda1437e8a71a8c9 | |
parent | a1661af17c9054a6c399dd9d5220f8d6a5091fa2 (diff) | |
download | wallabag-2e9747a59a6011622588829e4605af3710b61a21.tar.gz wallabag-2e9747a59a6011622588829e4605af3710b61a21.tar.zst wallabag-2e9747a59a6011622588829e4605af3710b61a21.zip |
Fix tests
-rw-r--r-- | src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php b/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php index b49166f2..439ae17d 100644 --- a/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php +++ b/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php | |||
@@ -18,16 +18,16 @@ class CustomPostgreSqlSchemaManager extends PostgreSqlSchemaManager | |||
18 | */ | 18 | */ |
19 | protected function _getPortableSequenceDefinition($sequence) | 19 | protected function _getPortableSequenceDefinition($sequence) |
20 | { | 20 | { |
21 | $sequenceName = $sequence['relname']; | ||
21 | if ('public' !== $sequence['schemaname']) { | 22 | if ('public' !== $sequence['schemaname']) { |
22 | $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname']; | 23 | $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname']; |
23 | } else { | ||
24 | $sequenceName = $sequence['relname']; | ||
25 | } | 24 | } |
26 | 25 | ||
27 | $query = 'SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName); | 26 | $query = 'SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName); |
28 | 27 | ||
29 | // patch for PostgreSql >= 10 | 28 | // the `method_exists` is only to avoid test to fail: |
30 | if ((float) ($this->_conn->getWrappedConnection()->getServerVersion()) >= 10) { | 29 | // DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticConnection doesn't support the `getServerVersion` |
30 | if (method_exists($this->_conn->getWrappedConnection(), 'getServerVersion') && (float) ($this->_conn->getWrappedConnection()->getServerVersion()) >= 10) { | ||
31 | $query = "SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = 'public' AND sequencename = " . $this->_conn->quote($sequenceName); | 31 | $query = "SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = 'public' AND sequencename = " . $this->_conn->quote($sequenceName); |
32 | } | 32 | } |
33 | 33 | ||