aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/db/pgsqltools.php
diff options
context:
space:
mode:
authortbelau666 <thomas.belau@gmx.de>2014-11-30 23:17:09 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-22 10:45:32 +0100
commitad8d55c3274e81dd4fd92b41ac5d6ef5c39febf3 (patch)
tree02d1ebe0f029d0bfa0371b9961e2a47988c719ba /lib/private/db/pgsqltools.php
parent5d296aa6b1fca69cfa14cc29eeb5f757a4b7dfad (diff)
downloadnextcloud-server-ad8d55c3274e81dd4fd92b41ac5d6ef5c39febf3.tar.gz
nextcloud-server-ad8d55c3274e81dd4fd92b41ac5d6ef5c39febf3.zip
Use Doctrines filter by table name
Doctrine's SchemaManager can filter table names by regular expression. On this way it picks up only ownClouds's tables in a database. by tbelau666
Diffstat (limited to 'lib/private/db/pgsqltools.php')
-rw-r--r--lib/private/db/pgsqltools.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/db/pgsqltools.php b/lib/private/db/pgsqltools.php
index c3ac140594d..6d17f8f40f8 100644
--- a/lib/private/db/pgsqltools.php
+++ b/lib/private/db/pgsqltools.php
@@ -21,6 +21,9 @@ class PgSqlTools {
*/
public function resynchronizeDatabaseSequences(Connection $conn) {
$databaseName = $conn->getDatabase();
+ $conn->getConfiguration()->
+ setFilterSchemaAssetsExpression('/^'.\OCP\Config::getSystemValue('dbtableprefix').'/');
+
foreach ($conn->getSchemaManager()->listSequences() as $sequence) {
$sequenceName = $sequence->getName();
$sqlInfo = 'SELECT table_schema, table_name, column_name