Task: Unify the SQL template to support validation function and insert trigger from entity models
This page documents a task in the Decommission ores.codegen.table model type story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
Running –profile sql on an ores.codegen.entity model produces byte-identical output to the current table-pathway for the same entity, including the validation function body and insert trigger.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Decommission ores.codegen.table model type |
| Now | Complete — done via the sibling story. |
| Waiting on | Nothing. |
| Next | None. |
| Last touched | 2026-07-10 |
3. Acceptance
- sql_schema_domain_entity_create.mustache generates a validation function body from entity model data.
- Insert trigger FK validations are rendered from entity model data.
- Output is byte-identical to the existing table-pathway SQL for at least one migrated entity (e.g. rounding_type).
4. Plan
(Implementation strategy. Written when work starts; key decisions
are distilled into the parent story's * Decisions at close, but the
plan itself stays — it is the historical record of what we did.)
5. Notes
6. PRs
| PR | Title |
|---|---|
7. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
8. Result
Done — this is the same work as B1: Extend entity SQL template to cover full table-template data shape in Resolve codegen model unification blockers, independently re-described here under a different story; no separate implementation needed.