Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-04 18:40:53 +0400
committerVincent Petry <pvince81@owncloud.com>2014-06-04 19:16:44 +0400
commit5b97369b00afbdf55eed145be9ac981dca06d2a9 (patch)
tree7dbbacea3c7a7253bc37a81d4d9636d320769cd5 /lib/private/db.php
parent5adb8f0a8a94b955fd031f8d8226e0cbffbfabb1 (diff)
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.php12
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;