fix(site-finder): SQLAlchemy syntax error :weights::jsonb → CAST(:weights AS jsonb) #152
1 changed files with 2 additions and 2 deletions
|
|
@ -99,7 +99,7 @@ _INSERT = """
|
|||
INSERT INTO user_weight_profiles
|
||||
(user_id, profile_name, weights, is_default, description)
|
||||
VALUES
|
||||
(:user_id, :profile_name, :weights::jsonb, :is_default, :description)
|
||||
(:user_id, :profile_name, CAST(:weights AS jsonb), :is_default, :description)
|
||||
RETURNING id, created_at, updated_at
|
||||
"""
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ def update_profile(
|
|||
params["profile_name"] = payload.profile_name
|
||||
|
||||
if payload.weights is not None:
|
||||
sets.append("weights = :weights::jsonb")
|
||||
sets.append("weights = CAST(:weights AS jsonb)")
|
||||
params["weights"] = json.dumps(payload.weights, ensure_ascii=False)
|
||||
|
||||
if payload.description is not None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue