fleettickets/migrations
david kiania dca2c94c75 fix: address valid findings from 20260618 bug report
Verified each finding against the code (+ profiled the 31k-row CSV sample);
implemented only the genuinely valid fixes:

- import_tickets.py: fold _record_meta into the upsert transaction so rows +
  snapshot meta commit atomically (BUG 2); guard _ts_from_key against
  regex-matching-but-invalid dates so the sort can't crash (BUG 11);
  extract_place now splits glued NW prefixes (~1.7k rows, e.g. NWKIAMBU→KIAMBU)
  and only drops a trailing '-<seg>' when it's a unit/instruction code, keeping
  real-word tails like '-MALL' (BUG 14). Scoped glued-split to NW only —
  CO/NE/SE begin real words (COAST/NEW/SEASONS) per the data.
- Dockerfile + pyproject.toml: install from pyproject (single source of truth)
  instead of mirroring deps; add build-system + py-modules so `pip install .`
  works for the flat-module layout (BUG 9).
- migrations/03_inc_columns.sql: document the eat_ts IMMUTABLE/tzdata footgun
  and the manual-recompute path (BUG 6).
- .gitignore: narrow *.json → *.local.json so real fixtures can be versioned;
  ignore build/ and *.egg-info/ (BUG 10).

Reclassified/skipped as invalid or by-design: BUG 1, 3, 4, 5, 7, 8, 12, 13.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:41:38 +03:00
..
01_tickets_schema.sql feat: fleettickets — INC/CRQ ticket ingestion, geocoding + read-schema 2026-06-11 20:13:50 +03:00
02_import_meta.sql feat: INC hourly-CSV ingestion (newest-file, ETag dedup, clean + archive) 2026-06-15 19:33:16 +03:00
03_inc_columns.sql fix: address valid findings from 20260618 bug report 2026-06-18 13:41:38 +03:00
04_inc_latlng.sql feat: populate inc latitude/longitude from geocoded geom (migration 04) 2026-06-15 23:26:39 +03:00
05_inc_geography.sql feat: add geography column + GiST index for routing (migration 05) 2026-06-15 23:33:45 +03:00
06_inc_mttr_minutes.sql feat: mttr -> minutes; drop constant alarm/auto flags (migration 06) 2026-06-15 23:51:28 +03:00
07_inc_drop_service_type.sql feat: drop constant service_type column (migration 07) 2026-06-15 23:54:43 +03:00
08_inc_open_sla_view.sql feat: tickets.inc_open_sla view + lowercase legacy region 2026-06-16 00:03:55 +03:00
09_inc_dashboard_fn.sql feat: reporting.fn_inc_dashboard — INC operations dashboard read-API (migration 09) 2026-06-16 01:10:18 +03:00
10_inc_history_capture.sql feat: history capture — closure_events + daily backlog snapshot (migration 10) 2026-06-16 01:19:23 +03:00