blob: 3094fff0d1de41919270d966c7d9dc8fbd76eee0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# 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
|