Skip to content

Commit

Permalink
better indexes
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Jan 22, 2024
1 parent 64ccc1e commit bbe1bee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions core/Migrations/Version29000Date20231126110901.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit bbe1bee

Please sign in to comment.