From e15823ef841816d03750b80c1e689bb2634cc0b7 Mon Sep 17 00:00:00 2001 From: malice Date: Thu, 2 Jul 2026 08:44:32 -0600 Subject: [PATCH] =?UTF-8?q?feat(persistence):=20v19=20schema=20=E2=80=94?= =?UTF-8?q?=20fire=20enrichment=20columns=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nullable fire_cause, unique_fire_id, geocoder_city columns to the fires table (additive migration, no backfill) and bump SCHEMA_VERSION 18 -> 19. Validated in production on CT 108 (schema_meta.version=19, clean run); commits the finished fire-spam/danger-zones migration that was live but uncommitted. Co-authored-by: Matt Johnson Co-authored-by: Claude Opus 4.8 (1M context) --- work/meshai/persistence/db.py | 2 +- work/meshai/persistence/migrations/v19.sql | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 work/meshai/persistence/migrations/v19.sql diff --git a/work/meshai/persistence/db.py b/work/meshai/persistence/db.py index cf3deaf..fd977ef 100644 --- a/work/meshai/persistence/db.py +++ b/work/meshai/persistence/db.py @@ -30,7 +30,7 @@ logger = logging.getLogger(__name__) DEFAULT_DB_PATH = "/data/meshai.sqlite" MESHAI_DB_PATH_ENV = "MESHAI_DB_PATH" -SCHEMA_VERSION = 18 +SCHEMA_VERSION = 19 SCHEMA_META_TABLE = "schema_meta" MIGRATIONS_DIR = Path(__file__).parent / "migrations" diff --git a/work/meshai/persistence/migrations/v19.sql b/work/meshai/persistence/migrations/v19.sql new file mode 100644 index 0000000..90d7d0e --- /dev/null +++ b/work/meshai/persistence/migrations/v19.sql @@ -0,0 +1,6 @@ +-- v19: fire_cause, unique_fire_id, geocoder_city columns for fire-alert enrichment. +-- Nullable TEXT, no index, no backfill. + +ALTER TABLE fires ADD COLUMN fire_cause TEXT; +ALTER TABLE fires ADD COLUMN unique_fire_id TEXT; +ALTER TABLE fires ADD COLUMN geocoder_city TEXT;