Fix Postgres 500 after a dialogue turn by qualifying usage upsert.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0ef3e3bb7a
commit
709370da93
|
|
@ -91,7 +91,7 @@ def increment_feature_usage(profile_id: str, feature_id: str) -> None:
|
||||||
INSERT INTO user_feature_usage (profile_id, feature_id, period_key, used)
|
INSERT INTO user_feature_usage (profile_id, feature_id, period_key, used)
|
||||||
VALUES (?, ?, ?, 1)
|
VALUES (?, ?, ?, 1)
|
||||||
ON CONFLICT(profile_id, feature_id, period_key)
|
ON CONFLICT(profile_id, feature_id, period_key)
|
||||||
DO UPDATE SET used = used + 1
|
DO UPDATE SET used = user_feature_usage.used + 1
|
||||||
""",
|
""",
|
||||||
(profile_id, feature_id, period),
|
(profile_id, feature_id, period),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user