From d841c960a340c4be2d97172e6071cc54bb97ab05 Mon Sep 17 00:00:00 2001 From: Rob Emery Date: Thu, 22 Feb 2024 12:10:04 +0000 Subject: [PATCH] Cleaning up unused indicies, fixes #5520 Signed-off-by: Rob Emery --- .../Version11000Date20240222115515.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/Migration/Version11000Date20240222115515.php diff --git a/lib/Migration/Version11000Date20240222115515.php b/lib/Migration/Version11000Date20240222115515.php new file mode 100644 index 000000000..77e3da918 --- /dev/null +++ b/lib/Migration/Version11000Date20240222115515.php @@ -0,0 +1,48 @@ +. + * + */ + +declare(strict_types=1); + + +namespace OCA\Deck\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +class Version11000Date20240222115515 extends SimpleMigrationStep { + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { + $schema = $schemaClosure(); + + $assigned_users_table = $schema->getTable('deck_assigned_users'); + if($assigned_users_table->hasIndex('deck_assigned_users_idx_c')) { + $assigned_users_table->dropIndex('deck_assigned_users_idx_c'); + } + + $board_acl_table = $schema->getTable('deck_board_acl'); + if($board_acl_table->hasIndex('deck_board_acl_idx_i')) { + $board_acl_table->dropIndex('deck_board_acl_idx_i'); + } + return $schema; + } +}