Database update for Flipper
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Râu Cao 2024-02-08 12:29:11 +01:00
parent 3b96130491
commit c9052b35f6
Signed by: raucao
GPG Key ID: 37036C356E56CC51
2 changed files with 23 additions and 5 deletions

View File

@ -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

View File

@ -10,12 +10,12 @@
#
# 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|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.integer "record_id", null: false
t.integer "blob_id", null: false
t.datetime "created_at", null: false
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
@ -34,7 +34,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_24_104909) do
end
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.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
@ -69,7 +69,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_10_24_104909) do
create_table "flipper_gates", force: :cascade do |t|
t.string "feature_key", null: false
t.string "key", null: false
t.string "value"
t.text "value"
t.datetime "created_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