diff --git a/db/post_migrate/20240507194839_drop_index_board_group_recent_visits_on_user_id.rb b/db/post_migrate/20240507194839_drop_index_board_group_recent_visits_on_user_id.rb new file mode 100644 index 0000000000000000000000000000000000000000..66a082fe636c222e109c7c64e7046ece0f3819fa --- /dev/null +++ b/db/post_migrate/20240507194839_drop_index_board_group_recent_visits_on_user_id.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DropIndexBoardGroupRecentVisitsOnUserId < Gitlab::Database::Migration[2.2] + milestone '17.1' + + disable_ddl_transaction! + + TABLE_NAME = :board_group_recent_visits + INDEX_NAME = :index_board_group_recent_visits_on_user_id + COLUMN_NAMES = [:user_id] + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, COLUMN_NAMES, name: INDEX_NAME) + end +end diff --git a/db/schema_migrations/20240507194839 b/db/schema_migrations/20240507194839 new file mode 100644 index 0000000000000000000000000000000000000000..cac9dd59e2b25a472c2729a4966e00120da73db3 --- /dev/null +++ b/db/schema_migrations/20240507194839 @@ -0,0 +1 @@ +781c517be22e5a832551c7f560959eb7b4845a8129cec3c7a8840d575215e363 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 45ab1acb41d7c70fdd6d00c034f5ebc483836d70..e0568bd8061618c7b7f1b725101bebfbfe3d3460 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -24557,8 +24557,6 @@ CREATE INDEX index_board_group_recent_visits_on_group_id ON board_group_recent_v CREATE UNIQUE INDEX index_board_group_recent_visits_on_user_group_and_board ON board_group_recent_visits USING btree (user_id, group_id, board_id); -CREATE INDEX index_board_group_recent_visits_on_user_id ON board_group_recent_visits USING btree (user_id); - CREATE UNIQUE INDEX index_board_labels_on_board_id_and_label_id ON board_labels USING btree (board_id, label_id); CREATE INDEX index_board_labels_on_label_id ON board_labels USING btree (label_id); diff --git a/spec/support/helpers/database/duplicate_indexes.yml b/spec/support/helpers/database/duplicate_indexes.yml index 5895ed0afb996b7c049671e950d45cbc34d566ba..9475aa28978942117383147ddb66c1fdd3b0d165 100644 --- a/spec/support/helpers/database/duplicate_indexes.yml +++ b/spec/support/helpers/database/duplicate_indexes.yml @@ -3,9 +3,6 @@ alert_management_http_integrations: index_http_integrations_on_project_and_endpoint: - index_alert_management_http_integrations_on_project_id -board_group_recent_visits: - index_board_group_recent_visits_on_user_group_and_board: - - index_board_group_recent_visits_on_user_id board_project_recent_visits: index_board_project_recent_visits_on_user_project_and_board: - index_board_project_recent_visits_on_user_id