aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-11-19 09:31:37 +0100
committerJulius Härtl <jus@bitgrid.net>2021-12-29 11:29:41 +0100
commitacaf214b674aa11e300b3fc8136de1073e4f37ef (patch)
tree9e7480f57a3e05fc04aaffccb1e7ca837cb0e442 /lib
parent0f9dff1683f39335fed72386485b99ea791c0368 (diff)
downloadnextcloud-server-acaf214b674aa11e300b3fc8136de1073e4f37ef.tar.gz
nextcloud-server-acaf214b674aa11e300b3fc8136de1073e4f37ef.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.php9
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']);