diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-06-04 16:40:53 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-06-04 17:16:44 +0200 |
commit | 5b97369b00afbdf55eed145be9ac981dca06d2a9 (patch) | |
tree | 7dbbacea3c7a7253bc37a81d4d9636d320769cd5 /lib/private/db/mdb2schemamanager.php | |
parent | 5adb8f0a8a94b955fd031f8d8226e0cbffbfabb1 (diff) | |
download | nextcloud-server-5b97369b00afbdf55eed145be9ac981dca06d2a9.tar.gz nextcloud-server-5b97369b00afbdf55eed145be9ac981dca06d2a9.zip |
Simulate apps database schema update on upgrade
When upgrade, also simulate the database schema update for apps before
doing the actual upgrade.
Diffstat (limited to 'lib/private/db/mdb2schemamanager.php')
-rw-r--r-- | lib/private/db/mdb2schemamanager.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php index 533ed9110e7..397aaf3608a 100644 --- a/lib/private/db/mdb2schemamanager.php +++ b/lib/private/db/mdb2schemamanager.php @@ -77,9 +77,10 @@ class MDB2SchemaManager { * update the database scheme * @param string $file file to read structure from * @param bool $generateSql only return the sql needed for the upgrade + * @param bool $simulate whether to simulate on separate tables instead of the real onces * @return string|boolean */ - public function updateDbFromStructure($file, $generateSql = false) { + public function updateDbFromStructure($file, $generateSql = false, $simulate = false) { $platform = $this->conn->getDatabasePlatform(); $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $platform); @@ -89,8 +90,12 @@ class MDB2SchemaManager { if ($generateSql) { return $migrator->generateChangeScript($toSchema); } else { - $migrator->checkMigrate($toSchema); - $migrator->migrate($toSchema); + if ($simulate) { + $migrator->checkMigrate($toSchema); + } + else { + $migrator->migrate($toSchema); + } return true; } } |