parent
eec574d10c
commit
0b95d26b40
5 changed files with 9 additions and 8 deletions
|
|
@ -327,10 +327,10 @@ def update_feature_flag(project_id: int, feature_flag_id: int,
|
|||
)
|
||||
|
||||
params = {
|
||||
**feature_flag.dict(),
|
||||
"updated_by": user_id,
|
||||
"feature_flag_id": feature_flag_id,
|
||||
"project_id": project_id,
|
||||
**feature_flag.dict(),
|
||||
"payload": json.dumps(feature_flag.payload),
|
||||
}
|
||||
|
||||
|
|
@ -455,7 +455,8 @@ def create_variants(feature_flag_id: int, variants: List[schemas.FeatureFlagVari
|
|||
"""
|
||||
|
||||
with pg_client.PostgresClient() as cur:
|
||||
params = [(feature_flag_id, v.value, v.description, json.dumps(v.payload), v.rollout_percentage) for v in variants]
|
||||
params = [(feature_flag_id, v.value, v.description, json.dumps(v.payload), v.rollout_percentage) for v in
|
||||
variants]
|
||||
query = cur.mogrify(sql, params)
|
||||
cur.execute(query)
|
||||
rows = cur.fetchall()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS public.feature_flags
|
|||
project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE,
|
||||
flag_key text NOT NULL,
|
||||
description text DEFAULT NULL,
|
||||
payload text DEFAULT NULL,
|
||||
payload jsonb DEFAULT NULL,
|
||||
flag_type text NOT NULL,
|
||||
is_persist boolean NOT NULL DEFAULT FALSE,
|
||||
is_active boolean NOT NULL DEFAULT FALSE,
|
||||
|
|
|
|||
|
|
@ -903,7 +903,7 @@ $$
|
|||
project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE,
|
||||
flag_key text NOT NULL,
|
||||
description text DEFAULT NULL,
|
||||
payload text DEFAULT NULL,
|
||||
payload jsonb DEFAULT NULL,
|
||||
flag_type text NOT NULL,
|
||||
is_persist boolean NOT NULL DEFAULT FALSE,
|
||||
is_active boolean NOT NULL DEFAULT FALSE,
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ CREATE TABLE IF NOT EXISTS public.feature_flags
|
|||
feature_flag_id integer generated BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE,
|
||||
flag_key text NOT NULL,
|
||||
description text DEFAULT NULL::text,
|
||||
payload text DEFAULT NULL::text,
|
||||
description text DEFAULT NULL,
|
||||
payload jsonb DEFAULT NULL,
|
||||
flag_type text NOT NULL,
|
||||
is_persist boolean NOT NULL DEFAULT FALSE,
|
||||
is_active boolean NOT NULL DEFAULT FALSE,
|
||||
|
|
@ -55,7 +55,7 @@ CREATE TABLE IF NOT EXISTS public.feature_flags_variants
|
|||
variant_id integer generated BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
feature_flag_id integer NOT NULL REFERENCES feature_flags (feature_flag_id) ON DELETE CASCADE,
|
||||
value text NOT NULL,
|
||||
description text DEFAULT NULL::text,
|
||||
description text DEFAULT NULL,
|
||||
payload jsonb DEFAULT NULL,
|
||||
rollout_percentage integer DEFAULT 0
|
||||
);
|
||||
|
|
|
|||
|
|
@ -983,7 +983,7 @@ $$
|
|||
project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE,
|
||||
flag_key text NOT NULL,
|
||||
description text DEFAULT NULL,
|
||||
payload text DEFAULT NULL,
|
||||
payload jsonb DEFAULT NULL,
|
||||
flag_type text NOT NULL,
|
||||
is_persist boolean NOT NULL DEFAULT FALSE,
|
||||
is_active boolean NOT NULL DEFAULT FALSE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue