debian-mirror-gitlab/db/post_migrate/20200518133123_add_index_on_starting_ending_at_to_metrics_dashboard_annotations.rb
2020-06-23 00:09:42 +05:30

19 lines
547 B
Ruby

# frozen_string_literal: true
class AddIndexOnStartingEndingAtToMetricsDashboardAnnotations < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_metrics_dashboard_annotations_on_timespan_end'
disable_ddl_transaction!
def up
add_concurrent_index :metrics_dashboard_annotations, 'COALESCE(ending_at, starting_at)', name: INDEX_NAME
end
def down
remove_concurrent_index :metrics_dashboard_annotations, 'COALESCE(ending_at, starting_at)', name: INDEX_NAME
end
end