diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-01-07 10:44:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-07 10:44:08 +0300 |
commit | adf01ab089dec4cfcd6eea64b5a74c3b28e6e171 (patch) | |
tree | f4a8698e0f768a91f15cc98325ad36a96128e93c /lib | |
parent | 5b241fb318bf8ecf6c82373d4a82f33e32c29e6a (diff) | |
parent | 5b4d362434a9b644a1209ce09556e96fa58bc2ea (diff) |
Merge pull request #30487 from nextcloud/backport/29780/stable22
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Installer.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index cacaafec671..d094dbba6e8 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -150,7 +150,7 @@ class Installer { //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']); @@ -596,8 +596,11 @@ class Installer { $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"); @@ -610,8 +613,6 @@ class Installer { 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']); |