diff --git a/appinfo/info.xml b/appinfo/info.xml index 485eb684c..62cdc63fb 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -50,6 +50,9 @@ Have a good time and manage whatever you want. + + OCA\Tables\Migration\FixContextsDefaults + OCA\Tables\Migration\NewDbStructureRepairStep OCA\Tables\Migration\DbRowSleeveSequence diff --git a/lib/Migration/FixContextsDefaults.php b/lib/Migration/FixContextsDefaults.php new file mode 100644 index 000000000..7e652fcab --- /dev/null +++ b/lib/Migration/FixContextsDefaults.php @@ -0,0 +1,46 @@ +config->getAppValue(Application::APP_ID, 'installed_version', '0.0'); + if (\version_compare($appVersion, '0.8.0-beta.1', '>')) { + $output->info('Not applicable, skipping.'); + return; + } + + $qb = $this->dbc->getQueryBuilder(); + $qb->update('tables_contexts_navigation') + ->set('display_mode', $qb->createNamedParameter(Application::NAV_ENTRY_MODE_ALL, IQueryBuilder::PARAM_INT)) + ->where($qb->expr()->eq('display_mode', $qb->createNamedParameter(Application::NAV_ENTRY_MODE_HIDDEN, IQueryBuilder::PARAM_INT))) + ->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter('', IQueryBuilder::PARAM_STR))) + ->executeStatement(); + } +}