debian-mirror-gitlab/db/migrate/20200306160521_add_index_on_author_id_and_created_at_to_events.rb

19 lines
422 B
Ruby
Raw Normal View History

2020-04-08 14:13:33 +05:30
# frozen_string_literal: true
class AddIndexOnAuthorIdAndCreatedAtToEvents < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
2020-06-23 00:09:42 +05:30
INDEX_NAME = 'index_events_on_author_id_and_created_at'
2020-04-08 14:13:33 +05:30
disable_ddl_transaction!
def up
2020-06-23 00:09:42 +05:30
add_concurrent_index :events, [:author_id, :created_at], name: INDEX_NAME
2020-04-08 14:13:33 +05:30
end
def down
2020-06-23 00:09:42 +05:30
remove_concurrent_index :events, INDEX_NAME
2020-04-08 14:13:33 +05:30
end
end