summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/app.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-01 16:56:34 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:01:19 +0200
commit15eec7b83c6198a124c2720e8ecc988605428f54 (patch)
tree62f47bb629b621b883efb17c02194972ba20a71f /lib/private/legacy/app.php
parentefa52ec1113eeccbd3935a8c96ea23c47ca190ab (diff)
downloadnextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.tar.gz
nextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.zip
Start migrations
Fixme: - Install and update of apps - No revert on live systems (debug only) - Service adjustment to our interface - Loading via autoloader Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r--lib/private/legacy/app.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 1bdbd1e2a83..631738c726b 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -50,6 +50,7 @@
use OC\App\DependencyAnalyzer;
use OC\App\InfoParser;
use OC\App\Platform;
+use OC\DB\MigrationService;
use OC\Installer;
use OC\Repair;
use OCP\App\ManagerEvent;
@@ -1043,12 +1044,18 @@ class OC_App {
}
$appData = self::getAppInfo($appId);
self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']);
- if (file_exists($appPath . '/appinfo/database.xml')) {
+
+ if (isset($appData['use-migrations']) && $appData['use-migrations'] === 'true') {
+ $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']);
self::setupLiveMigrations($appId, $appData['repair-steps']['live-migration']);
unset(self::$appVersion[$appId]);
+
// run upgrade code
if (file_exists($appPath . '/appinfo/update.php')) {
self::loadApp($appId);