fix: stranger_id=NULL on bind/merge; doc: add traces+mergeinto endpoints

This commit is contained in:
Accusys
2026-05-25 03:02:19 +08:00
parent 78923a8973
commit 8fdd1d741b
3 changed files with 279 additions and 5 deletions

View File

@@ -100,7 +100,7 @@ pub async fn bind_identity(
// Direct UPDATE face_detections.identity_id
let result = sqlx::query(&format!(
"UPDATE {} SET identity_id = $1 WHERE file_uuid = $2 AND face_id = $3",
"UPDATE {} SET identity_id = $1, stranger_id = NULL WHERE file_uuid = $2 AND face_id = $3",
table
))
.bind(identity_id)
@@ -272,7 +272,7 @@ pub async fn merge_identities(
// Transfer all face bindings from source → target
let updated = sqlx::query(&format!(
"UPDATE {} SET identity_id = $1 WHERE identity_id = $2",
"UPDATE {} SET identity_id = $1, stranger_id = NULL WHERE identity_id = $2",
face_table
))
.bind(into_id)
@@ -427,7 +427,7 @@ pub async fn bind_identity_trace(
})?;
let result = sqlx::query(&format!(
"UPDATE {} SET identity_id = $1 WHERE file_uuid = $2 AND trace_id = $3",
"UPDATE {} SET identity_id = $1, stranger_id = NULL WHERE file_uuid = $2 AND trace_id = $3",
fd_table
))
.bind(identity_id)