# 3002/3003 Schema Separation Status Date: 2026-05-17 Status: ✅ Pipeline tables created in `public`; schema incompatibilities remain ## Summary | Schema | Has pipeline tables | Has auth tables | Used by | |--------|-------------------|-----------------|---------| | `public` | ✅ (newly created) | ✅ (original) | 3002 (production) — currently using `dev` as workaround | | `dev` | ✅ (full, working) | ✅ (synced) | 3003 (playground) | ## What Was Done ### Pipeline tables created in `public` schema (11 tables) - `videos`, `chunk`, `chunk_vectors`, `cuts`, `frames` - `monitor_jobs`, `processor_results`, `processor_versions` - `parent_chunks`, `tkg_edges`, `tkg_nodes` All include proper sequences, indexes, and constraints matching the `dev` schema. ## Remaining Blockers ### Schema incompatibilities between `dev` and `public` | Table | dev cols | public cols | Status | |-------|---------|------------|--------| | identities | 17 | 16 | ⚠️ Different columns (e.g. `name` vs `real_name`/`actor_name`) | | face_detections | 16 | 17 | ⚠️ Column count mismatch | | identity_bindings | 7 | 8 | ⚠️ Column count mismatch | | person_identities | 16 | 15 | ⚠️ Column count mismatch | | pre_chunks | 19 | 10 | ⚠️ Significantly different | | api_keys | 19 | 19 | ✅ Match | | resources | 9 | 9 | ✅ Match | | users | 8 | 8 | ✅ Match | ### Identities table key differences - `public.identities` uses `real_name` + `actor_name` (old schema) - `dev.identities` uses `name` (new unified schema) - `dev.identities` has `tmdb_poster`, `file_uuid`, `face_embedding`, `voice_embedding`, `identity_embedding` - `public.identities` only has `face_embedding`, `voice_embedding` (no `identity_embedding`) ## Options ### Option A: Full data migration (recommended for later) 1. Dump data from old public tables 2. Drop old public tables 3. Recreate from dev schema DDL 4. Migrate data with column mapping 5. Switch 3002 to `DATABASE_SCHEMA=public` ### Option B: Keep current workaround (simplest for now) - 3002 continues with `DATABASE_SCHEMA=dev` - 3003 uses `DATABASE_SCHEMA=dev` - Both share the same schema, but have separate Redis key prefixes + ports ### Option C: Rename dev → public (requires downtime) 1. Stop all services 2. Rename `dev` schema to something else 3. Rename `public` to `public_old` 4. Rename `dev` to `public` 5. Update references ## Current Status ✅ Pipeline tables exist in both schemas ✅ auth tables (users, sessions, jwt_blacklist) exist in both ✅ Redis key prefixes separate (`momentry:` vs `momentry_dev:`) ⚠️ 3002 still uses `DATABASE_SCHEMA=dev` workaround ⛔ Shared tables need migration before 3002 can use `public` schema