summaryrefslogtreecommitdiffstats
path: root/lib/private/db.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-04 18:15:58 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-04 18:17:46 +0200
commitd4ffafe4674dbda984c78ea9f7db894156e2a764 (patch)
tree80206d4c25c38092219ca74b4170893ade376e3f /lib/private/db.php
parent5b97369b00afbdf55eed145be9ac981dca06d2a9 (diff)
downloadnextcloud-server-d4ffafe4674dbda984c78ea9f7db894156e2a764.tar.gz
nextcloud-server-d4ffafe4674dbda984c78ea9f7db894156e2a764.zip
Removed simulate db update flag and split into separate methods
Diffstat (limited to 'lib/private/db.php')
-rw-r--r--lib/private/db.php29
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/private/db.php b/lib/private/db.php
index f6854e3e162..82affe293ed 100644
--- a/lib/private/db.php
+++ b/lib/private/db.php
@@ -307,21 +307,32 @@ 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, $simulate = false) {
+ public static function updateDbFromStructure($file) {
$schemaManager = self::getMDB2SchemaManager();
try {
- $result = $schemaManager->updateDbFromStructure($file, false, $simulate);
+ $result = $schemaManager->updateDbFromStructure($file);
} catch (Exception $e) {
- 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);
- }
+ OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL);
+ throw $e;
+ }
+ return $result;
+ }
+
+ /**
+ * simulate the database schema update
+ * @param string $file file to read structure from
+ * @throws Exception
+ * @return string|boolean
+ */
+ public static function simulateUpdateDbFromStructure($file) {
+ $schemaManager = self::getMDB2SchemaManager();
+ try {
+ $result = $schemaManager->simulateUpdateDbFromStructure($file);
+ } catch (Exception $e) {
+ OC_Log::write('core', 'Simulated database structure update failed ('.$e.')', OC_Log::FATAL);
throw $e;
}
return $result;