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.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.php')
-rw-r--r-- | lib/private/db.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/db.php b/lib/private/db.php index 422f783c745..f6854e3e162 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -307,15 +307,21 @@ class OC_DB { /** * update the database schema * @param string $file file to read structure from + * @param bool $simulate whether to simulate the upgrade on separate tables * @throws Exception * @return string|boolean */ - public static function updateDbFromStructure($file) { + public static function updateDbFromStructure($file, $simulate = false) { $schemaManager = self::getMDB2SchemaManager(); try { - $result = $schemaManager->updateDbFromStructure($file); + $result = $schemaManager->updateDbFromStructure($file, false, $simulate); } catch (Exception $e) { - OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL); + if ($simulate) { + OC_Log::write('core', 'Database structure update simulation failed ('.$e.')', OC_Log::FATAL); + } + else { + OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL); + } throw $e; } return $result; |