diff options
Diffstat (limited to 'db/post_migrate/20230721200323_drop_index_on_issues_closed_incidents_by_project_id_and_closed_at.rb')
-rw-r--r-- | db/post_migrate/20230721200323_drop_index_on_issues_closed_incidents_by_project_id_and_closed_at.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20230721200323_drop_index_on_issues_closed_incidents_by_project_id_and_closed_at.rb b/db/post_migrate/20230721200323_drop_index_on_issues_closed_incidents_by_project_id_and_closed_at.rb new file mode 100644 index 00000000000..243c9f458d9 --- /dev/null +++ b/db/post_migrate/20230721200323_drop_index_on_issues_closed_incidents_by_project_id_and_closed_at.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropIndexOnIssuesClosedIncidentsByProjectIdAndClosedAt < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_issues_closed_incidents_by_project_id_and_closed_at' + + def up + remove_concurrent_index_by_name :issues, name: INDEX_NAME + end + + def down + add_concurrent_index :issues, [:project_id, :closed_at], where: 'issue_type = 1 AND state_id = 2', name: INDEX_NAME + end +end |