Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Run migrations fully when reenabling an app
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Jan 4, 2022
commit 5b4d362434a9b644a1209ce09556e96fa58bc2ea
9 changes: 5 additions & 4 deletions lib/private/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function installApp(string $appId, bool $forceEnable = false): string {

//install the database
$ms = new MigrationService($info['id'], \OC::$server->get(Connection::class));
$ms->migrate('latest', true);
$ms->migrate('latest', !$previousVersion);

if ($previousVersion) {
OC_App::executeRepairSteps($appId, $info['repair-steps']['post-migration']);
Expand Down Expand Up @@ -596,8 +596,11 @@ public static function installShippedApp($app) {
$appPath = OC_App::getAppPath($app);
\OC_App::registerAutoloading($app, $appPath);

$config = \OC::$server->getConfig();

$ms = new MigrationService($app, \OC::$server->get(Connection::class));
$ms->migrate('latest', true);
$previousVersion = $config->getAppValue($app, 'installed_version', false);
$ms->migrate('latest', !$previousVersion);

//run appinfo/install.php
self::includeAppScript("$appPath/appinfo/install.php");
Expand All @@ -610,8 +613,6 @@ public static function installShippedApp($app) {

OC_App::executeRepairSteps($app, $info['repair-steps']['install']);

$config = \OC::$server->getConfig();

$config->setAppValue($app, 'installed_version', OC_App::getAppVersion($app));
if (array_key_exists('ocsid', $info)) {
$config->setAppValue($app, 'ocsid', $info['ocsid']);
Expand Down