summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-04-01 00:25:47 +0000
committerTom Needham <needham.thomas@gmail.com>2012-04-01 00:25:47 +0000
commiteba6a65908ab848741a29467a2c054818e3c740c (patch)
treedebe939209c4cf030c722ace3036f7cfabdb1e30 /lib/db.php
parentffbd72bbcf775ac31a43b958ec1e8eaddf0f8356 (diff)
downloadnextcloud-server-eba6a65908ab848741a29467a2c054818e3c740c.tar.gz
nextcloud-server-eba6a65908ab848741a29467a2c054818e3c740c.zip
try to use transactions to replace db
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/db.php b/lib/db.php
index a7b7ae75da0..9c46a40addb 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -489,7 +489,7 @@ class OC_DB {
public static function replaceDB( $file ){
$apps = OC_App::getAllApps();
-
+ self::beginTransaction();
// Delete the old tables
self::removeDBStructure( OC::$SERVERROOT . '/db_structure.xml' );
@@ -501,11 +501,8 @@ class OC_DB {
}
// Create new tables
- if( self::createDBFromStructure( $file ) ){
- return true;
- } else {
- return false;
- }
+ self::createDBFromStructure( $file );
+ self::commit();
}