diff options
author | tbelau666 <thomas.belau@gmx.de> | 2014-11-30 23:17:09 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-22 10:45:32 +0100 |
commit | ad8d55c3274e81dd4fd92b41ac5d6ef5c39febf3 (patch) | |
tree | 02d1ebe0f029d0bfa0371b9961e2a47988c719ba /lib/private/db/migrator.php | |
parent | 5d296aa6b1fca69cfa14cc29eeb5f757a4b7dfad (diff) | |
download | nextcloud-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/migrator.php')
-rw-r--r-- | lib/private/db/migrator.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/db/migrator.php b/lib/private/db/migrator.php index 31c648a9b65..903e9b8a716 100644 --- a/lib/private/db/migrator.php +++ b/lib/private/db/migrator.php @@ -69,7 +69,9 @@ class Migrator { * @var \Doctrine\DBAL\Schema\Table[] $tables */ $tables = $targetSchema->getTables(); - + + $this->connection->getConfiguration()-> + setFilterSchemaAssetsExpression('/^'.\OCP\Config::getSystemValue('dbtableprefix').'/'); $existingTables = $this->connection->getSchemaManager()->listTableNames(); foreach ($tables as $table) { @@ -153,6 +155,8 @@ class Migrator { } protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) { + $connection->getConfiguration()-> + setFilterSchemaAssetsExpression('/^'.\OCP\Config::getSystemValue('dbtableprefix').'/'); $sourceSchema = $connection->getSchemaManager()->createSchema(); // remove tables we don't know about |