diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 18:09:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 18:09:45 +0300 |
commit | aaf59610548d9b0fd01acfd50e831cbe519ecba2 (patch) | |
tree | b6505abedcd965ebae5118b504b185b63129dc4c /db/migrate | |
parent | 1363ca12f1f07c634647cf55c4c16b7401098673 (diff) |
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.rb | 18 |
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 |