Database update for Flipper
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ChangeFlipperGatesValueToText < ActiveRecord::Migration[7.1]
|
||||
def up
|
||||
# Ensure this incremental update migration is idempotent
|
||||
return unless connection.column_exists? :flipper_gates, :value, :string
|
||||
|
||||
if index_exists? :flipper_gates, [:feature_key, :key, :value]
|
||||
remove_index :flipper_gates, [:feature_key, :key, :value]
|
||||
end
|
||||
change_column :flipper_gates, :value, :text
|
||||
add_index :flipper_gates, [:feature_key, :key, :value], unique: true, length: { value: 255 }
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :flipper_gates, :value, :string
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user