Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb')
-rw-r--r--db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb b/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb
new file mode 100644
index 00000000000..fb379d48b2a
--- /dev/null
+++ b/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class IndexMembersOnUserIdAccessLevelRequestedAtIsNull < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_members_on_user_id_and_access_level_requested_at_is_null'
+
+ def up
+ add_concurrent_index(:members, [:user_id, :access_level], where: 'requested_at IS NULL', name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(:members, INDEX_NAME)
+ end
+end