diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 35f51b19b0..87cb262c96 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -139,6 +139,9 @@ class Installer { } else { OC_DB::updateDbFromStructure($basedir.'/appinfo/database.xml'); } + } else { + $ms = new \OC\DB\MigrationService($info['id'], \OC::$server->getDatabaseConnection()); + $ms->migrate(); } \OC_App::registerAutoloading($appId, $basedir); @@ -540,6 +543,9 @@ class Installer { 0, $e ); } + } else { + $ms = new \OC\DB\MigrationService($app, \OC::$server->getDatabaseConnection()); + $ms->migrate(); } //run appinfo/install.php diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 631738c726..3ca05d85c2 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -1045,11 +1045,11 @@ class OC_App { $appData = self::getAppInfo($appId); self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']); - if (isset($appData['use-migrations']) && $appData['use-migrations'] === 'true') { + if (file_exists($appPath . '/appinfo/database.xml')) { + OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml'); + } else { $ms = new MigrationService($appId, \OC::$server->getDatabaseConnection()); $ms->migrate(); - } else if (file_exists($appPath . '/appinfo/database.xml')) { - OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml'); } self::executeRepairSteps($appId, $appData['repair-steps']['post-migration']);