diff options
Diffstat (limited to 'db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb')
-rw-r--r-- | db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb b/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb new file mode 100644 index 00000000000..34a357bdc5c --- /dev/null +++ b/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveUniqueIndexForSprintsOnProjectIdAndTitle < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_sprints_on_project_id_and_title' + + def up + remove_concurrent_index_by_name :sprints, INDEX_NAME + end + + def down + add_concurrent_index :sprints, [:project_id, :title], where: "project_id IS NOT NULL", name: INDEX_NAME, unique: true + end +end |