From bedbe30fd22fe30e2cd477db99c169db86f1b62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 11 Nov 2020 16:09:28 +0100 Subject: [PATCH] Add migration to fix wrong index on type (fixes #1884) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../Version1000Date20200308073933.php | 3 +- .../Version10200Date20201111150114.php | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 lib/Migration/Version10200Date20201111150114.php diff --git a/lib/Migration/Version1000Date20200308073933.php b/lib/Migration/Version1000Date20200308073933.php index 3fcab3dfe..64259231b 100644 --- a/lib/Migration/Version1000Date20200308073933.php +++ b/lib/Migration/Version1000Date20200308073933.php @@ -39,7 +39,8 @@ class Version1000Date20200308073933 extends SimpleMigrationStep { 'notnull' => true, 'default' => 0 ]); - $table->addIndex(['participant'], 'deck_assigned_users_idx_t'); + //$table->addIndex(['participant'], 'deck_assigned_users_idx_t'); + $table->addIndex(['type'], 'deck_assigned_users_idx_ty'); return $schema; } diff --git a/lib/Migration/Version10200Date20201111150114.php b/lib/Migration/Version10200Date20201111150114.php new file mode 100644 index 000000000..85bbffabe --- /dev/null +++ b/lib/Migration/Version10200Date20201111150114.php @@ -0,0 +1,36 @@ +getTable('deck_assigned_users'); + if ($table->hasIndex('deck_assigned_users_idx_t')) { + $table->dropIndex('deck_assigned_users_idx_t'); + if (!$table->hasIndex('deck_assigned_users_idx_ty')) { + $table->addIndex(['type'], 'deck_assigned_users_idx_ty'); + } + } + + return $schema; + } + + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { + } +}