aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Doctrine
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Doctrine')
-rw-r--r--src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php8
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