diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 18:06:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 18:06:17 +0300 |
commit | 00c78fb814d7ce00989ac04edd6cdaa3239da284 (patch) | |
tree | f04920f08eb4e481ce27bd1d96862676dff735dc /db/migrate/20191016072826_replace_ci_trigger_requests_index.rb | |
parent | d2ffc30fd583e86d4122bb5061098f4f3ca7b3f1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20191016072826_replace_ci_trigger_requests_index.rb')
-rw-r--r-- | db/migrate/20191016072826_replace_ci_trigger_requests_index.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb b/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb new file mode 100644 index 00000000000..d7c9524806e --- /dev/null +++ b/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class ReplaceCiTriggerRequestsIndex < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc } + + remove_concurrent_index :ci_trigger_requests, [:trigger_id] + end + + def down + add_concurrent_index :ci_trigger_requests, [:trigger_id] + + remove_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc } + end +end |