mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
21 lines
953 B
MySQL
21 lines
953 B
MySQL
|
|
-- Migration: 022_add_eonet_adapter
|
||
|
|
-- Adds the NASA EONET adapter row to config.adapters.
|
||
|
|
-- Ships disabled; operator enables via GUI.
|
||
|
|
--
|
||
|
|
-- The settings JSON below is the literal output of EONETSettings().model_dump_json()
|
||
|
|
-- at migration-author time. Regenerate via:
|
||
|
|
-- sudo -u central .venv/bin/python -c \
|
||
|
|
-- "from central.adapters.eonet import EONETSettings; print(EONETSettings().model_dump_json())"
|
||
|
|
-- Do NOT hand-edit the category_allowlist here — _DEFAULT_CATEGORIES in
|
||
|
|
-- src/central/adapters/eonet.py is the single source of truth.
|
||
|
|
--
|
||
|
|
-- Idempotent: uses ON CONFLICT DO NOTHING.
|
||
|
|
|
||
|
|
INSERT INTO config.adapters (name, enabled, cadence_s, settings)
|
||
|
|
VALUES (
|
||
|
|
'eonet',
|
||
|
|
false,
|
||
|
|
1800,
|
||
|
|
'{"category_allowlist":["drought","dustHaze","earthquakes","floods","landslides","manmade","seaLakeIce","severeStorms","snow","tempExtremes","volcanoes","waterColor","wildfires"],"region":null}'::jsonb
|
||
|
|
)
|
||
|
|
ON CONFLICT (name) DO NOTHING;
|