Database update for Flipper
This commit is contained in:
parent
3b96130491
commit
c9052b35f6
@ -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
|
10
db/schema.rb
10
db/schema.rb
@ -10,12 +10,12 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2023_10_24_104909) do
|
ActiveRecord::Schema[7.1].define(version: 2024_02_07_080515) do
|
||||||
create_table "active_storage_attachments", force: :cascade do |t|
|
create_table "active_storage_attachments", force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "record_type", null: false
|
t.string "record_type", null: false
|
||||||
t.bigint "record_id", null: false
|
t.integer "record_id", null: false
|
||||||
t.bigint "blob_id", null: false
|
t.integer "blob_id", null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
||||||
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
||||||
@ -34,7 +34,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_24_104909) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
create_table "active_storage_variant_records", force: :cascade do |t|
|
create_table "active_storage_variant_records", force: :cascade do |t|
|
||||||
t.bigint "blob_id", null: false
|
t.integer "blob_id", null: false
|
||||||
t.string "variation_digest", null: false
|
t.string "variation_digest", null: false
|
||||||
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||||
end
|
end
|
||||||
@ -69,7 +69,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_24_104909) do
|
|||||||
create_table "flipper_gates", force: :cascade do |t|
|
create_table "flipper_gates", force: :cascade do |t|
|
||||||
t.string "feature_key", null: false
|
t.string "feature_key", null: false
|
||||||
t.string "key", null: false
|
t.string "key", null: false
|
||||||
t.string "value"
|
t.text "value"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
|
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user