docs: add REFERENCE docs, M4 workspace, Caddyfile
This commit is contained in:
13
release/migrate_add_stranger_id.sql
Normal file
13
release/migrate_add_stranger_id.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- Migration: Add stranger_id column for unmatched face traces
|
||||
-- Unmatched traces get stranger_id = trace_id (per-file sequential integer)
|
||||
-- Unique constraint: (file_uuid, stranger_id) WHERE stranger_id IS NOT NULL
|
||||
-- Date: 2026-05-16
|
||||
-- Usage: psql -U accusys -d momentry -f migrate_add_stranger_id.sql
|
||||
|
||||
ALTER TABLE face_detections ADD COLUMN IF NOT EXISTS stranger_id INTEGER;
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_face_detections_stranger
|
||||
ON face_detections (file_uuid, stranger_id) WHERE stranger_id IS NOT NULL;
|
||||
|
||||
-- Assign stranger_id = trace_id for existing unmatched traces
|
||||
UPDATE face_detections SET stranger_id = trace_id
|
||||
WHERE trace_id IS NOT NULL AND identity_id IS NULL AND stranger_id IS NULL;
|
||||
Reference in New Issue
Block a user