Task: Write .org models for market_series, market_observation, market_fixing and regenerate
This page documents a task in the Codegen SQL variability for hypertable, bi-temporal and GIST patterns; model ores.marketdata entities story. It captures the goal, current status, acceptance, and any notes or results.
Goal
All three ores.marketdata entities are fully described in .org models and all codegen output is byte-identical to what is currently hand-written, making future changes go through the model.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Codegen SQL variability for hypertable, bi-temporal and GIST patterns; model ores.marketdata entities |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-06-30 |
Acceptance
- compass codegen entity diff shows zero diff for market_series, market_observation and market_fixing across all profiles.
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.)
Notes
PRs
| PR | Title |
|---|---|
| #1381 | [codegen] SQL variability flags + market data entity models |
Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
Result
Three org models written and committed:
ores.marketdata.market_series— standard temporal (version, audit columns, GIST, tenant in PK)ores.marketdata.market_observation— hypertable onobservation_datetime, soft_update_delete trigger, no audit columns, nullablepoint_idnatural key, custom indexes withcoalesce(point_id, '')ores.marketdata.market_fixing— hypertable onfixing_date, soft_update_delete trigger, no audit columns
Template variability flags added in this story (hypertable, bitemporal_soft_update, has_audit_columns, suppress_nk_index) enable all three shapes. Codegen produces correct SQL; zero-diff regression check passes on the existing gmm entity.