-- +goose Up -- Provenance of opportunities.value, for Revenue at Risk honesty (W2). The default representative means -- every existing and seeded row is treated as demo data until a sync stamps it real, so the dollar can -- never be presented as a real headline by accident. federal_ref is the future link to the cached -- federal source (a sam notice_id or a usaspending generated_internal_id) a backfill will populate. -- Additive: no data is rewritten, every current row defaults to representative. ALTER TABLE opportunities ADD COLUMN IF NOT EXISTS value_source text NOT NULL DEFAULT 'representative' CHECK (value_source IN ('representative', 'operator', 'sam', 'usaspending')); ALTER TABLE opportunities ADD COLUMN IF NOT EXISTS federal_ref text; -- +goose Down ALTER TABLE opportunities DROP COLUMN IF EXISTS federal_ref; ALTER TABLE opportunities DROP COLUMN IF EXISTS value_source;