Browse Source

Merge pull request #15783 from nextcloud/bugfix/6015/app-enable-migration

Run repair steps when enabling an app that has already been installed
tags/v17.0.0beta1
John Molakvoæ 5 years ago
parent
commit
18d85d46d1
No account linked to committer's email address
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      lib/private/Installer.php

+ 8
- 0
lib/private/Installer.php View File

\OC_App::checkAppDependencies($this->config, $l, $info, $ignoreMax); \OC_App::checkAppDependencies($this->config, $l, $info, $ignoreMax);
\OC_App::registerAutoloading($appId, $basedir); \OC_App::registerAutoloading($appId, $basedir);


$previousVersion = $this->config->getAppValue($info['id'], 'installed_version', false);
if ($previousVersion) {
OC_App::executeRepairSteps($appId, $info['repair-steps']['pre-migration']);
}

//install the database //install the database
if(is_file($basedir.'/appinfo/database.xml')) { if(is_file($basedir.'/appinfo/database.xml')) {
if (\OC::$server->getConfig()->getAppValue($info['id'], 'installed_version') === null) { if (\OC::$server->getConfig()->getAppValue($info['id'], 'installed_version') === null) {
$ms = new \OC\DB\MigrationService($info['id'], \OC::$server->getDatabaseConnection()); $ms = new \OC\DB\MigrationService($info['id'], \OC::$server->getDatabaseConnection());
$ms->migrate(); $ms->migrate();
} }
if ($previousVersion) {
OC_App::executeRepairSteps($appId, $info['repair-steps']['post-migration']);
}


\OC_App::setupBackgroundJobs($info['background-jobs']); \OC_App::setupBackgroundJobs($info['background-jobs']);



Loading…
Cancel
Save