chore(schema): migrate flipper value string to text
This commit is contained in:
parent
57b398adf3
commit
aa7d3a7656
2 changed files with 21 additions and 1 deletions
|
@ -0,0 +1,20 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ChangeFlipperGatesValueToText < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
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 }, algorithm: :concurrently
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :flipper_gates, :value, :string
|
||||
end
|
||||
end
|
|
@ -614,7 +614,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_15_164247) do
|
|||
t.string "feature_key", null: false
|
||||
t.string "key", null: false
|
||||
t.datetime "updated_at", precision: nil, null: false
|
||||
t.string "value"
|
||||
t.text "value"
|
||||
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue