diff --git a/db/post_migrate/20220919050555_drop_tmp_index_user_callouts_on_attention_request_feature_names.rb b/db/post_migrate/20220919050555_drop_tmp_index_user_callouts_on_attention_request_feature_names.rb new file mode 100644 index 0000000000000000000000000000000000000000..e456a91fe3f5a46e880b3e6f11797f31cc845491 --- /dev/null +++ b/db/post_migrate/20220919050555_drop_tmp_index_user_callouts_on_attention_request_feature_names.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropTmpIndexUserCalloutsOnAttentionRequestFeatureNames < Gitlab::Database::Migration[2.0] + INDEX_NAME = "tmp_index_user_callouts_on_attention_request_feature_names" + ATTENTION_REQUEST_CALLOUTS = [47, 48] + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :user_callouts, INDEX_NAME + end + + def down + add_concurrent_index :user_callouts, [:id], + where: "feature_name IN (#{ATTENTION_REQUEST_CALLOUTS.join(',')})", + name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20220919050555 b/db/schema_migrations/20220919050555 new file mode 100644 index 0000000000000000000000000000000000000000..29d8d1508092e090cad66d85c63928aec7641e63 --- /dev/null +++ b/db/schema_migrations/20220919050555 @@ -0,0 +1 @@ +ac61a72c2c197735404e6bccf3f2ceb9c3f5ff79c7df58f83b6ab1b55b81e532 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 7ab085f79d75308a4be6053b7b92061c43ac19d2..b3125fd31c391c504314537ce53db65b3e03c33e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -30900,8 +30900,6 @@ CREATE INDEX tmp_index_system_note_metadata_on_attention_request_actions ON syst CREATE INDEX tmp_index_system_note_metadata_on_id_where_task ON system_note_metadata USING btree (id, action) WHERE ((action)::text = 'task'::text); -CREATE INDEX tmp_index_user_callouts_on_attention_request_feature_names ON user_callouts USING btree (id) WHERE (feature_name = ANY (ARRAY[47, 48])); - CREATE INDEX tmp_index_vulnerability_occurrences_on_id_and_scanner_id ON vulnerability_occurrences USING btree (id, scanner_id) WHERE (report_type = ANY (ARRAY[7, 99])); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);