4f7162be4f
**修正**: - 008: ALTER TABLE chunks → chunk, 跳過已存在的表 - 010: ALTER TABLE chunks → chunk - 011-016: 跳過 talents 相關 migration(identities 已存在) **原因**: - Hardcoded DDL 已創建 identities, identity_bindings, characters, castings - Migration 使用 chunks(複數),代碼使用 chunk(單數) - 避免表名衝突和重複創建 **目標**: 讓 41/41 migration 成功執行
24 lines
1.1 KiB
SQL
24 lines
1.1 KiB
SQL
-- 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
|