fix: upsert_trace_profile preserves VLM fields on conflict
The ON CONFLICT DO UPDATE clause was missing vlm_* columns, causing Face Cluster (P3) label sync to overwrite and lose VLM data. Added COALESCE preservation for: vlm_description, vlm_clothing, vlm_tags, vlm_location, vlm_setting, vlm_lighting, vlm_weather, vlm_hand_objects, vlm_has_plants, vlm_has_animals, vlm_background, vlm_bg_tags, vlm_model, vlm_embedding, vlm_point_id
This commit is contained in:
@@ -75,6 +75,21 @@ pub async fn upsert_trace_profile(
|
|||||||
best_capture_quality = COALESCE(EXCLUDED.best_capture_quality, {tp_table}.best_capture_quality), \
|
best_capture_quality = COALESCE(EXCLUDED.best_capture_quality, {tp_table}.best_capture_quality), \
|
||||||
avg_bbox = COALESCE(EXCLUDED.avg_bbox, {tp_table}.avg_bbox), \
|
avg_bbox = COALESCE(EXCLUDED.avg_bbox, {tp_table}.avg_bbox), \
|
||||||
best_bbox = COALESCE(EXCLUDED.best_bbox, {tp_table}.best_bbox), \
|
best_bbox = COALESCE(EXCLUDED.best_bbox, {tp_table}.best_bbox), \
|
||||||
|
vlm_description = COALESCE(EXCLUDED.vlm_description, {tp_table}.vlm_description), \
|
||||||
|
vlm_clothing = COALESCE(EXCLUDED.vlm_clothing, {tp_table}.vlm_clothing), \
|
||||||
|
vlm_tags = COALESCE(EXCLUDED.vlm_tags, {tp_table}.vlm_tags), \
|
||||||
|
vlm_location = COALESCE(EXCLUDED.vlm_location, {tp_table}.vlm_location), \
|
||||||
|
vlm_setting = COALESCE(EXCLUDED.vlm_setting, {tp_table}.vlm_setting), \
|
||||||
|
vlm_lighting = COALESCE(EXCLUDED.vlm_lighting, {tp_table}.vlm_lighting), \
|
||||||
|
vlm_weather = COALESCE(EXCLUDED.vlm_weather, {tp_table}.vlm_weather), \
|
||||||
|
vlm_hand_objects = COALESCE(EXCLUDED.vlm_hand_objects, {tp_table}.vlm_hand_objects), \
|
||||||
|
vlm_has_plants = COALESCE(EXCLUDED.vlm_has_plants, {tp_table}.vlm_has_plants), \
|
||||||
|
vlm_has_animals = COALESCE(EXCLUDED.vlm_has_animals, {tp_table}.vlm_has_animals), \
|
||||||
|
vlm_background = COALESCE(EXCLUDED.vlm_background, {tp_table}.vlm_background), \
|
||||||
|
vlm_bg_tags = COALESCE(EXCLUDED.vlm_bg_tags, {tp_table}.vlm_bg_tags), \
|
||||||
|
vlm_model = COALESCE(EXCLUDED.vlm_model, {tp_table}.vlm_model), \
|
||||||
|
vlm_embedding = COALESCE(EXCLUDED.vlm_embedding, {tp_table}.vlm_embedding), \
|
||||||
|
vlm_point_id = COALESCE(EXCLUDED.vlm_point_id, {tp_table}.vlm_point_id), \
|
||||||
updated_at = NOW()",
|
updated_at = NOW()",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user