-- +goose Up -- National OEWS wage expansion (M5 Phase 1). The national wage sync (cmd/oews-national-sync) upserts one -- row per (occupation_code, area, metric), so it needs a UNIQUE on that natural key to upsert on. This is -- ADDITIVE and safe: the existing HI and NM Galapagos rows the rates sync writes are already unique on -- (occupation_code, area, metric) because that sync emits exactly one series per occupation, area, and -- metric, so the constraint is satisfied by the current data. bls_wages stays a GLOBAL public reference -- table (no organization_id, outside Row Level Security); this is a constraint, not an RLS change. -- -- The constraint is named and additive so it can be dropped cleanly on rollback without touching the -- series_id primary key, which stays the identity of a row. ALTER TABLE bls_wages ADD CONSTRAINT bls_wages_occ_area_metric_key UNIQUE (occupation_code, area, metric); -- +goose Down ALTER TABLE bls_wages DROP CONSTRAINT IF EXISTS bls_wages_occ_area_metric_key;