diff options
Diffstat (limited to 'db/migrate/20191016072826_replace_ci_trigger_requests_index.rb')
-rw-r--r-- | db/migrate/20191016072826_replace_ci_trigger_requests_index.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb b/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb deleted file mode 100644 index 8faa6c3847f..00000000000 --- a/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb +++ /dev/null @@ -1,32 +0,0 @@ -# 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 } - - # Some installations have legacy, duplicate indexes on - # ci_trigger_requests.trigger_id. Rails won't drop them without an - # explicit name: https://gitlab.com/gitlab-org/gitlab/issues/34818 - old_index_names.each do |name| - remove_concurrent_index :ci_trigger_requests, [:trigger_id], name: name - end - end - - def down - add_concurrent_index :ci_trigger_requests, [:trigger_id] - - remove_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc } - end - - private - - def old_index_names - indexes(:ci_trigger_requests).select { |i| i.columns == ['trigger_id'] }.map(&:name) - end -end |