feat(storage): migrate project to sqlite

This commit is contained in:
dasemu committed 2026-03-13 06:50:18 +01:00
1 parent 1bc1e58781
commit 9c8ba03574
17 files changed
+1204 -688

No files matched your search

+12
View File
@@ -9,3 +9,15 @@
**Example:** The production JSON at `/opt/skipredictor/data/processed/predictions_latest.json` on the server contained valid predictions under `stations`, and the checked-in [telegram_bot.py](/home/dasemu/Hacking/Darío Sevilla/skipredictor/bot/telegram_bot.py) still expected top-level station keys plus legacy fields like `station_open_probability`, while [collect_daily_data.py](/home/dasemu/Hacking/Darío Sevilla/skipredictor/scripts/collect_daily_data.py) writes predictions under `stations` with fields such as `open_probability` and `km_open`.
**Files affected:** `bot/telegram_bot.py`, `scripts/collect_daily_data.py`
## Migration Scope - 2026-03-13
**What went wrong:** I started a database migration while preserving compatibility fallbacks to the previous CSV/JSON storage flow.
**Root cause:** I optimized for low-risk rollout instead of following the user's explicit migration intent. In this repository, that creates extra complexity and leaves ambiguous sources of truth.
**Prevention rule:** When the user asks for a migration in this repo and does not request coexistence, implement a single authoritative path after the migration. Do not keep legacy file fallbacks unless the user asks for a transitional phase.
**Example:** The SQLite migration must make the bot, the daily pipeline, and model training read from the database directly instead of keeping fallbacks to `data/processed/predictions_latest.json` or `data/processed/dataset_featured.csv`.
**Files affected:** `bot/telegram_bot.py`, `scripts/collect_daily_data.py`, `ml/train_model.py`