terra_31: per-modulo field definitions + per-practica values (terraModuloCampos, terraPracticasCampos), seed 4 implantologia/reconstruccion fields with empty terra vocab categories
Child of TERRA-76, design in its comment 2026-08-22. ACCEPTANCE: (1) migration terra_31 in db/migrations/applied with the two tables as specified (terraModuloCampos UNIQUE(moduloId,key); terraPracticasCampos uuid PK, UNIQUE partial live (practicaId,campoKey) WHERE deletedAt IS NULL, FK practicaId->terraPracticas, archive-on-soft-delete + requireArchiveCtx + forbidHardDelete + forbidTruncate armed tgenabled=A, archive sink reuse per terra_28 widening); (2) seed rows: for moduloId of 'Implantologia' and 'Reconstruccion alveolar' (resolve by nombre, RAISE if 0 or >1) four campos: tipoInjerto/zonaDadora/tipoBarrera (reconstruccion) and marcaImplante (implantologia) - confirm which modulo gets which with coder before seeding if pm/05 is silent; inputType lookup, lookupCategory terraTipoInjerto/terraZonaDadora/terraTipoBarrera/terraMarcaImplante, categories created EMPTY (no lookupOptions rows) with a terra vocabularyScopes include row so resolveScopedVocabulary returns [] not all; (3) views vTerraModuloCampos (isActive) and vTerraPracticasCampos (deletedAt IS NULL); (4) GRANTs consistent with terraPracticasComplicaciones; (5) gate passes (tag in file), db-enamel-cc GO not needed unless a shared object is touched - state which objects; (6) reply on this WI with applied SHA. Coder builds form/action/detail after apply.
Activity
-
parent=#2717
-
db-terra-cc: terra_31 drafted in db/migrations/draft/, pre-apply audit next
-
terra_31_modulo_campos APPLIED 2026-08-22, supabase_migrations version 20260822083403, by db-terra-cc. Applied text verified identical to the file (stored statement md5 dceea2b83728072df28456c6104cb55a). PASS audit-terra-ca-mt448g6a3pe1 (gating, r4 - closed their view-ACL BLOCK), audit-pluto-ca-mt43smi9xs3v (r3 source), coder-terra-cc-mt43u3hdfbwj. Live post-state: 10 ENABLE ALWAYS triggers, 4 campos, 4 empty terra scope rows, 0 values, view service_role privilege = {SELECT}, 0 fixture rows left. Bound: guards are ARM-TESTED at apply time, NOT production-exercised - no src writer exists yet. Not committed yet: coder-terra-cc pushes.
-
Pushed by coder-terra-cc as 9f62d0a (649da4a..9f62d0a, main): both migrations, 6 evidence artifacts, db/schema-live.md. Applied version 20260822083403 is now tracked with its audit tags in-file, so applied-and-cited is satisfied. Closing.
-
completed