v0.14.5: migration 042 re-asserts central ownership of config.monitoring_areas (#111)

Append idempotent ALTER ... OWNER TO central for the table + SERIAL sequence so fresh installs are self-healing; prod already patched inline during v0.14.0. Adds whitespace-insensitive static-check assertions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
malice 2026-06-15 22:02:02 -06:00 committed by GitHub
commit 3361abaa92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View file

@ -46,3 +46,13 @@ WHERE id = true
AND monitor_east IS NOT NULL
AND monitor_west IS NOT NULL
ON CONFLICT (name) DO NOTHING;
-- Ownership fix (v0.14.5). During the v0.14.0 prod deploy (2026-06-12) this
-- migration was applied as `sudo -u postgres`, so the table + its SERIAL
-- sequence ended up owned by postgres while the `central` app role expects
-- ownership-based access (it could read but not manage the new config table).
-- We patched prod inline with these same ALTERs; making them part of the file
-- keeps fresh installs self-healing. Idempotent: a no-op when already owned by
-- central. (See central-manual-migration-owner-role.)
ALTER TABLE config.monitoring_areas OWNER TO central;
ALTER SEQUENCE config.monitoring_areas_id_seq OWNER TO central;