Task: Write .org models for market_series, market_observation, market_fixing and regenerate

Table of Contents

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 on observation_datetime, soft_update_delete trigger, no audit columns, nullable point_id natural key, custom indexes with coalesce(point_id, '')
  • ores.marketdata.market_fixing — hypertable on fixing_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.

Emacs 29.3 (Org mode 9.6.15)