Fix concurrent index problem
This commit is contained in:
parent
bdb06db0f6
commit
40181bfcab
|
@ -7,6 +7,5 @@ class AddIdentifierToPrometheusMetric < ActiveRecord::Migration
|
|||
|
||||
def change
|
||||
add_column :prometheus_metrics, :identifier, :string
|
||||
add_index :prometheus_metrics, :identifier, unique: true
|
||||
end
|
||||
end
|
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIdentifierToPrometheusMetric < ActiveRecord::Migration
|
||||
include Gitlab::Database::MigrationHelpers
|
||||
|
||||
DOWNTIME = false
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_index :prometheus_metrics, :identifier, unique: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index :prometheus_metrics, :identifier, unique: true
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20180831164909) do
|
||||
ActiveRecord::Schema.define(version: 20180831164910) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
Loading…
Reference in New Issue