DB: add disney_park column + service_entrances table #35

Closed
opened 2026-05-22 21:48:02 +00:00 by shawn · 0 comments
Owner

Problem

The assets table was missing a disney_park column needed for Disney park classification (already used in disney_classify.py). Also needed a new service_entrances table to track entry points at locations.

Fix

  • Added disney_park TEXT DEFAULT NULL to assets table in _create_v2_tables()
  • Created service_entrances table: id, location_id (FK→locations, ON DELETE CASCADE), name (NOT NULL), latitude (NOT NULL), longitude (NOT NULL), notes, timestamps
  • Added v4 migration in init_db(): ALTER TABLE for disney_park on existing DBs, schema-aware recreation of service_entrances if name column lacks NOT NULL constraint

Commits

  • 27f372e — DB schema: add disney_park column to assets, create service_entrances table

Tests

  • 44/45 backend tests pass (one pre-existing 404 on stats endpoint)
  • Verified with fresh schema (SQLite :memory:) — all constraints enforced
  • Verified migration against live assets.db
## Problem The assets table was missing a `disney_park` column needed for Disney park classification (already used in `disney_classify.py`). Also needed a new `service_entrances` table to track entry points at locations. ## Fix - Added `disney_park TEXT DEFAULT NULL` to assets table in `_create_v2_tables()` - Created `service_entrances` table: id, location_id (FK→locations, ON DELETE CASCADE), name (NOT NULL), latitude (NOT NULL), longitude (NOT NULL), notes, timestamps - Added v4 migration in `init_db()`: ALTER TABLE for disney_park on existing DBs, schema-aware recreation of service_entrances if name column lacks NOT NULL constraint ## Commits - 27f372e — DB schema: add disney_park column to assets, create service_entrances table ## Tests - 44/45 backend tests pass (one pre-existing 404 on stats endpoint) - Verified with fresh schema (SQLite :memory:) — all constraints enforced - Verified migration against live assets.db
shawn closed this issue 2026-05-22 21:48:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shawn/canteen-asset-tracker#35