diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-01-04 17:16:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 17:16:57 +0100 |
commit | 8dd65ebd058bc5ec4663f36d16b539ee58de49a6 (patch) | |
tree | f775fd6b8fdf94c1538cd8ae4d41b7ab41081570 /lib | |
parent | 130d3bd8d33cef1bc61979157dff063427bc8c5b (diff) | |
parent | acaf214b674aa11e300b3fc8136de1073e4f37ef (diff) | |
download | nextcloud-server-8dd65ebd058bc5ec4663f36d16b539ee58de49a6.tar.gz nextcloud-server-8dd65ebd058bc5ec4663f36d16b539ee58de49a6.zip |
Merge pull request #29780 from nextcloud/bugfix/noid/run-migrations-fuly-on-reenabling
Run migrations fully when reenabling an app
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 f3af74167d1..b63619b821c 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -151,7 +151,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']); @@ -597,8 +597,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"); @@ -611,8 +614,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']); |