-- Migration: 008_person_identity_binding.sql -- Purpose: 建立聲紋 (Speaker ID)、人臉 (Face ID) 與真實身份 (Identity) 的綁定系統 -- Date: 2026-04-10 -- 1. 擴展 chunk 表,增加聲音與面孔的觀測值陣列 ALTER TABLE chunk ADD COLUMN IF NOT EXISTS speaker_ids TEXT[] DEFAULT '{}', -- e.g. ['speaker_3', 'speaker_5'] ADD COLUMN IF NOT EXISTS face_ids TEXT[] DEFAULT '{}'; -- e.g. ['face_1'] -- 2. 真實身份表 (Talents / Identities) -- SKIPPED: identities table already created in hardcoded DDL -- Migration 012-016 will handle talents -> identities rename, but identities already exists -- So we skip this section to avoid conflicts -- 3. 建立身份綁定映射表 (Identity Bindings) -- 負責將機器生成的 ID (face_x, speaker_y) 映射到 identity_id -- SKIPPED: identity_bindings table already created in hardcoded DDL -- 4. (選填) 建立角色表 (Characters) - 用於動畫/多語系場景 -- SKIPPED: characters table already created in hardcoded DDL -- 5. (選填) 建立飾演關係表 (Castings) -- SKIPPED: castings table already created in hardcoded DDL