diff options
author | Joas Schilling <coding@schilljs.com> | 2021-11-19 09:31:37 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-01-07 08:50:31 +0100 |
commit | 67a43a6ad441093db6191c6310d710d2bd2584d0 (patch) | |
tree | da53e771ee87138992a5d88ccf98c84a7e217e9a /lib | |
parent | 67a7eefa5bdb69484333e15e0fe3243050569fa4 (diff) | |
download | nextcloud-server-67a43a6ad441093db6191c6310d710d2bd2584d0.tar.gz nextcloud-server-67a43a6ad441093db6191c6310d710d2bd2584d0.zip |
Run migrations fully when reenabling an app
Signed-off-by: Joas Schilling <coding@schilljs.com>
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 65740c32c57..2d09065be5c 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -159,7 +159,7 @@ class Installer { } } else { $ms = new \OC\DB\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']); @@ -606,6 +606,8 @@ class Installer { $appPath = OC_App::getAppPath($app); \OC_App::registerAutoloading($app, $appPath); + $config = \OC::$server->getConfig(); + if (is_file("$appPath/appinfo/database.xml")) { try { OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); @@ -617,8 +619,9 @@ class Installer { ); } } else { + $previousVersion = $config->getAppValue($app, 'installed_version', false); $ms = new \OC\DB\MigrationService($app, \OC::$server->get(Connection::class)); - $ms->migrate('latest', true); + $ms->migrate('latest', !$previousVersion); } //run appinfo/install.php @@ -632,8 +635,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']); |