summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 00:09:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 00:09:11 +0000
commit0914eb1a9ca655784302e3a21635d58c7e7af7c2 (patch)
treee9596e315a904ef9c5036332a81b73681fa5239f /db
parentfcfe959a5ddee652a27e6b1179a116fdbb70986b (diff)
downloadgitlab-ce-0914eb1a9ca655784302e3a21635d58c7e7af7c2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb17
-rw-r--r--db/schema_migrations/202209222041061
-rw-r--r--db/structure.sql2
3 files changed, 18 insertions, 2 deletions
diff --git a/db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb b/db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb
new file mode 100644
index 00000000000..033b04a75f8
--- /dev/null
+++ b/db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveIndexForRequestedNonInvitedAwaitingMembers < Gitlab::Database::Migration[2.0]
+ INDEX_NAME = 'index_members_on_non_requested_non_invited_and_state_awaiting'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :members, INDEX_NAME
+ end
+
+ def down
+ clause = '((requested_at IS NULL) AND (invite_token IS NULL) AND (access_level > 5) AND (state = 1))'
+
+ add_concurrent_index :members, :source_id, where: clause, name: INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20220922204106 b/db/schema_migrations/20220922204106
new file mode 100644
index 00000000000..0eabc077b58
--- /dev/null
+++ b/db/schema_migrations/20220922204106
@@ -0,0 +1 @@
+e1106d4b77704a1ac4c185e0a6b500966dc61f46569de55650875aa6a89b7f9d \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index eb7e6fab790..d6665c0999d 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -29229,8 +29229,6 @@ CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member
CREATE INDEX index_members_on_member_role_id ON members USING btree (member_role_id);
-CREATE INDEX index_members_on_non_requested_non_invited_and_state_awaiting ON members USING btree (source_id) WHERE ((requested_at IS NULL) AND (invite_token IS NULL) AND (access_level > 5) AND (state = 1));
-
CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at);
CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type);