mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Add flipper for feature flags
This commit is contained in:
5
db/migrate/20250611061502_add_beta_features_to_users.rb
Normal file
5
db/migrate/20250611061502_add_beta_features_to_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddBetaFeaturesToUsers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :users, :beta_features, :text, default: '[]'
|
||||
end
|
||||
end
|
||||
22
db/migrate/20250611062306_create_flipper_tables.rb
Normal file
22
db/migrate/20250611062306_create_flipper_tables.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class CreateFlipperTables < ActiveRecord::Migration[8.0]
|
||||
def up
|
||||
create_table :flipper_features do |t|
|
||||
t.string :key, null: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :flipper_features, :key, unique: true
|
||||
|
||||
create_table :flipper_gates do |t|
|
||||
t.string :feature_key, null: false
|
||||
t.string :key, null: false
|
||||
t.text :value
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :flipper_gates, [ :feature_key, :key, :value ], unique: true, length: { value: 255 }
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :flipper_gates
|
||||
drop_table :flipper_features
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveBetaFeaturesFromUsers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
remove_column :users, :beta_features, :text
|
||||
end
|
||||
end
|
||||
18
db/schema.rb
generated
18
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_09_203830) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_11_062456) do
|
||||
create_schema "pganalyze"
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
@@ -107,6 +107,22 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_09_203830) do
|
||||
t.index ["user_id"], name: "index_email_verification_requests_on_user_id"
|
||||
end
|
||||
|
||||
create_table "flipper_features", force: :cascade do |t|
|
||||
t.string "key", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["key"], name: "index_flipper_features_on_key", unique: true
|
||||
end
|
||||
|
||||
create_table "flipper_gates", force: :cascade do |t|
|
||||
t.string "feature_key", null: false
|
||||
t.string "key", null: false
|
||||
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
|
||||
end
|
||||
|
||||
create_table "good_job_batches", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
||||
Reference in New Issue
Block a user