From bbe1bee6262c3762b51c7409eba1ef6c27e36425 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 22 Jan 2024 18:15:05 -0100 Subject: [PATCH] better indexes Signed-off-by: Maxence Lange --- .../Version29000Date20231126110901.php | 22 ++++++++++--------- version.php | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/core/Migrations/Version29000Date20231126110901.php b/core/Migrations/Version29000Date20231126110901.php index 3867074e013c8..c805140cfcdf4 100644 --- a/core/Migrations/Version29000Date20231126110901.php +++ b/core/Migrations/Version29000Date20231126110901.php @@ -43,23 +43,25 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return null; } + $changed = false; $table = $schema->getTable('appconfig'); - if ($table->hasColumn('lazy')) { - return null; + if (!$table->hasColumn('lazy')) { + $changed = true; + // type=2 means value is typed as MIXED + $table->addColumn('type', Types::INTEGER, ['notnull' => true, 'default' => 2]); + $table->addColumn('lazy', Types::BOOLEAN, ['notnull' => false, 'default' => false]); } - // type=2 means value is typed as MIXED - $table->addColumn('type', Types::INTEGER, ['notnull' => true, 'default' => 2]); - $table->addColumn('lazy', Types::BOOLEAN, ['notnull' => false, 'default' => false]); - if ($table->hasIndex('appconfig_config_key_index')) { + $changed = true; $table->dropIndex('appconfig_config_key_index'); } - $table->addIndex(['lazy'], 'ac_lazy_i'); - $table->addIndex(['appid', 'lazy'], 'ac_app_lazy_i'); - $table->addIndex(['appid', 'lazy', 'configkey'], 'ac_app_lazy_key_i'); + if (!$table->hasIndex('ac_lazy_i')) { + $changed = true; + $table->addIndex(['lazy'], 'ac_lazy_i'); + } - return $schema; + return ($changed) ? $schema : null; } } diff --git a/version.php b/version.php index 47ada5b87774c..a1855bfad5aa2 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ // between betas, final and RCs. This is _not_ the public version number. Reset minor/patch level // when updating major/minor version number. -$OC_Version = [29, 0, 0, 4]; +$OC_Version = [29, 0, 0, 5]; // The human-readable string $OC_VersionString = '29.0.0 dev';