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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 18:08:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 18:08:16 +0300
commite80e0dd64fbb04f60394cb1bb08e17dbcb22b8ce (patch)
tree9e538341b9b77e96737964813e10235dbecf47ff /db/migrate/20200323074147_add_temp_index_on_users_bio.rb
parentef31adeb0fb9a02b2c6a4529ec4e38d7082a4b2b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200323074147_add_temp_index_on_users_bio.rb')
-rw-r--r--db/migrate/20200323074147_add_temp_index_on_users_bio.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20200323074147_add_temp_index_on_users_bio.rb b/db/migrate/20200323074147_add_temp_index_on_users_bio.rb
new file mode 100644
index 00000000000..4b26bb971f5
--- /dev/null
+++ b/db/migrate/20200323074147_add_temp_index_on_users_bio.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddTempIndexOnUsersBio < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'tmp_idx_on_user_id_where_bio_is_filled'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :users, :id, where: "(COALESCE(bio, '') IS DISTINCT FROM '')", name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :users, INDEX_NAME
+ end
+end