Forward-compat schema change. Even though only ERCOT data lives in these tables today, adding the column now avoids a multi-million-row migration after v1.0.0.
Required changes
- Migration: add
iso TEXT NOT NULL DEFAULT 'ERCOT' to esiids
- Migration: add
iso TEXT NOT NULL DEFAULT 'ERCOT' to pipeline_runs (currently has tdsp which is ERCOT-specific; this is a parent dimension, not a replacement)
- Add B-tree index on
(iso) and consider composite (iso, esiid) — the existing UNIQUE(esiid) constraint should likely become UNIQUE(iso, native_id) once the schema strategy ADR lands
- Update
Esiid and PipelineRun models to include the field
- Default to
'ERCOT' everywhere on insert for now
Notes
The final shape of these columns (especially the unique constraint) will be revisited as part of the v0.2.0 schema strategy ADR — but the column existing is forward-compat regardless of which strategy wins.
Context
See docs/multi-iso-plan.md for the broader multi-ISO architectural plan.
Forward-compat schema change. Even though only ERCOT data lives in these tables today, adding the column now avoids a multi-million-row migration after v1.0.0.
Required changes
iso TEXT NOT NULL DEFAULT 'ERCOT'toesiidsiso TEXT NOT NULL DEFAULT 'ERCOT'topipeline_runs(currently hastdspwhich is ERCOT-specific; this is a parent dimension, not a replacement)(iso)and consider composite(iso, esiid)— the existingUNIQUE(esiid)constraint should likely becomeUNIQUE(iso, native_id)once the schema strategy ADR landsEsiidandPipelineRunmodels to include the field'ERCOT'everywhere on insert for nowNotes
The final shape of these columns (especially the unique constraint) will be revisited as part of the v0.2.0 schema strategy ADR — but the column existing is forward-compat regardless of which strategy wins.
Context
See
docs/multi-iso-plan.mdfor the broader multi-ISO architectural plan.