analytics/priv/repo/migrations/20220421074114_create_feature_flags_table.exs
2022-04-21 10:54:08 +03:00

29 lines
845 B
Elixir

defmodule Plausible.Repo.Migrations.CreateFeatureFlagsTable do
use Ecto.Migration
# This migration assumes the default table name of "fun_with_flags_toggles"
# is being used. If you have overridden that via configuration, you should
# change this migration accordingly.
def up do
create table(:fun_with_flags_toggles, primary_key: false) do
add :id, :bigserial, primary_key: true
add :flag_name, :string, null: false
add :gate_type, :string, null: false
add :target, :string, null: false
add :enabled, :boolean, null: false
end
create index(
:fun_with_flags_toggles,
[:flag_name, :gate_type, :target],
unique: true,
name: "fwf_flag_name_gate_target_idx"
)
end
def down do
drop table(:fun_with_flags_toggles)
end
end