diff options
Diffstat (limited to 'db/migrate/20220901035722_add_temp_project_member_index.rb')
-rw-r--r-- | db/migrate/20220901035722_add_temp_project_member_index.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20220901035722_add_temp_project_member_index.rb b/db/migrate/20220901035722_add_temp_project_member_index.rb new file mode 100644 index 00000000000..0765ef09b5c --- /dev/null +++ b/db/migrate/20220901035722_add_temp_project_member_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddTempProjectMemberIndex < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = :members + INDEX_NAME = 'index_project_members_on_id_temp' + + def up + add_concurrent_index TABLE_NAME, :id, name: INDEX_NAME, where: "source_type = 'Project'" + end + + def down + remove_concurrent_index TABLE_NAME, :id, name: INDEX_NAME + end +end |