Skip to content

Add iso column to esiids and pipeline_runs (default 'ERCOT') #54

@haydenk

Description

@haydenk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dbDatabase migrations / sqlx cachearea:multi-isoMulti-ISO architecture / provider abstractiontaskChore, refactor, or infrastructure work

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions