Use migrations when there is no database.xml

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-06-02 13:22:25 +02:00 committed by Morris Jobke
parent 15eec7b83c
commit 183b1dbde3
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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']);