summaryrefslogtreecommitdiffstats
path: root/lib/private/db/mdb2schemamanager.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-04 16:40:53 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-04 17:16:44 +0200
commit5b97369b00afbdf55eed145be9ac981dca06d2a9 (patch)
tree7dbbacea3c7a7253bc37a81d4d9636d320769cd5 /lib/private/db/mdb2schemamanager.php
parent5adb8f0a8a94b955fd031f8d8226e0cbffbfabb1 (diff)
downloadnextcloud-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.php11
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;
}
}