diff options
Diffstat (limited to 'db/migrate/20220124200927_add_index_to_issues.rb')
-rw-r--r-- | db/migrate/20220124200927_add_index_to_issues.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20220124200927_add_index_to_issues.rb b/db/migrate/20220124200927_add_index_to_issues.rb new file mode 100644 index 00000000000..03cdc3ade2c --- /dev/null +++ b/db/migrate/20220124200927_add_index_to_issues.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToIssues < Gitlab::Database::Migration[1.0] + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'index_issues_on_id_and_weight' + + def up + add_concurrent_index :issues, [:id, :weight], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :issues, INDEX_NAME + end +end |