summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 15:09:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 15:09:45 +0000
commitaaf59610548d9b0fd01acfd50e831cbe519ecba2 (patch)
treeb6505abedcd965ebae5118b504b185b63129dc4c /db/migrate
parent1363ca12f1f07c634647cf55c4c16b7401098673 (diff)
downloadgitlab-ce-aaf59610548d9b0fd01acfd50e831cbe519ecba2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200312125121_add_index_on_active_and_template_and_type_and_id_to_services.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20200312125121_add_index_on_active_and_template_and_type_and_id_to_services.rb b/db/migrate/20200312125121_add_index_on_active_and_template_and_type_and_id_to_services.rb
new file mode 100644
index 00000000000..3a2390bb6a1
--- /dev/null
+++ b/db/migrate/20200312125121_add_index_on_active_and_template_and_type_and_id_to_services.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexOnActiveAndTemplateAndTypeAndIdToServices < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_services_on_type_and_id_and_template_when_active'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :services, [:type, :id, :template], where: 'active = TRUE', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index :services, INDEX_NAME
+ end
+end