central/sql/migrations/032_remove_state_511_atis_adapters.sql
zvx-echo6 47a5c2b60e v0.10.3: rip out state_511_atis adapter (superseded by itd_511 v0.10.0; Castle Rock legacy shape EOL per sister-site discovery)
Removes both Castle Rock-backed adapters: state_511_atis (incidents/closures/road
work) AND state_511_atis_cameras (telemetry). Same upstream dependency, same
redundancy now that itd_511 + itd_511_cameras (v0.10.0) cover Idaho via the
official ITD REST API. The sister-site discovery confirmed no other Castle Rock
customer still exposes the legacy /map/mapIcons/ + /List/GetData/ shape these
adapters consumed (modern Castle Rock customers run an auth-gated SPA product).

What goes:
  - src/central/adapters/state_511_atis.py + state_511_atis_cameras.py
  - tests/test_state_511_atis.py + test_state_511_atis_cameras.py
  - 4 GUI partials under src/central/gui/templates/_event_{rows,summaries}/
  - 7 fixtures under tests/fixtures/state_511_atis_*
  - test_gui_adapter_edit.py::test_state_511_atis_no_bbox_map (imported the
    deleted module)
  - 2 _SAMPLE_INNER + 1 _EXPECTED_SUBJECT entries in test_events_feed_frontend.py
  - state_511_atis_cameras from _TELEMETRY list in test_telemetry_separation.py
  - 2 doc subsections in docs/CONSUMER-INTEGRATION.md §6
  - state_511_atis + state_511_atis_cameras entries from ADAPTER_GROUPS

What stays:
  - public.events rows from the deleted adapters (preserved as historical
    record per Matt; archive will not re-publish these ids since the supervisor
    no longer polls the adapters).
  - CENTRAL_TRAFFIC stream (wzdx, tomtom_*, itd_511 still publish to it).

Added: sql/migrations/032_remove_state_511_atis_adapters.sql -- idempotent
DELETE on config.adapters for both adapter names.

Added: tests/test_consumer_doc.py::test_castle_rock_legacy_adapters_remain_removed
regression guard against accidental re-introduction by a future revert.

Test suite: 996 passed / 1 skipped under both zvx and central (was 1029 / 1
on main; net -33 = 17 from deleted test files + 16 from auto-shrunk
parametrizations over discover_adapters() and _EXPECTED_SUBJECT).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-06 18:17:18 +00:00

13 lines
674 B
SQL

-- v0.10.3: rip out state_511_atis + state_511_atis_cameras (Castle Rock legacy
-- shape EOL; superseded by itd_511 + itd_511_cameras from migration 031 / v0.10.0).
--
-- Idempotent: the DELETE succeeds whether the rows are present or not. Historical
-- events in public.events stay (preserved as historical record per Matt's call);
-- only the config.adapters rows that would otherwise be hot-reloaded into the
-- supervisor are removed.
--
-- Note: cursors.db cleanup (published_ids for both adapters) is a SQLite-side
-- step handled at deploy time, NOT in this Postgres migration.
DELETE FROM config.adapters
WHERE name IN ('state_511_atis', 'state_511_atis_cameras');