summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb')
-rw-r--r--db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb b/db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb
new file mode 100644
index 00000000000..25b7fe7f7bb
--- /dev/null
+++ b/db/post_migrate/20220517101119_create_confidential_notes_index_synchronously.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class CreateConfidentialNotesIndexSynchronously < Gitlab::Database::Migration[2.0]
+ INDEX_NAME = 'index_notes_on_confidential'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :notes, :confidential, where: 'confidential = true', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :notes, name: INDEX_NAME
+ end
+end