PH1.2 — Schema 0003: planning tables and typed mapped classes #10
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Depends on
#14 PH1.6 — Seed: sample FleetPulse feed, catalogue, three crews, week of shifts, dev persons
patrick/Polaris
#15 PH1.7 — API surface: every DTO and endpoint from docs/09-api.md stubbed, openapi.json committed
patrick/Polaris
#45 PH6.4 — Retention job per Q16
patrick/Polaris
Reference
patrick/Polaris#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Row PH1.2 in
docs/12-implementation-plan.md(branch, owned paths and doc section are defined there).What to build
Migration
0003creates the planning and execution tables (solver_run, plan_version, plan_version_date, assignment, unassigned_job, plan_lock, validation_finding, service_feedback, reliability_score, notification) with all indexes from docs/08-data-model.md, plus typed mapped classes. Schema is complete after this ticket.Acceptance criteria
alembic upgrade headthendowngrade -1round-trips cleanly on a real Postgresmypy --strictbase → head → basemigrates cleanlyBlocked by
Starting PH1.2 (schema 0003: planning tables and typed mapped classes).
Branch:
feature/db-schema-planning(frommain, which already has0002_master_data_tables.py).Owned paths:
backend/alembic/versions/**,backend/src/polaris/db/models/**.Will build migration
0003for solver_run, plan_version, plan_version_date, assignment, unassigned_job, plan_lock, validation_finding, service_feedback, reliability_score, notification per docs/08-data-model.md, plus matching typed SQLAlchemy mapped classes following the_mixins.py/_types.py/_enum.pypattern from PH1.1.PR opened: #66 (
feature/db-schema-planning->main). All four acceptance criteria ticked above.Verified against a real
postgis/postgis:17-3.4container (testcontainers):alembic upgrade head/downgrade -1/upgrade +1round-trip cleanly, and the full chainbase -> head -> basemigrates cleanly.mypy --strictandruffclean; full backend suite green.One seam note: fixing this ticket's own point (creating
solver_run) broke a pre-existing PH6.6 test that asserted/metricsomitssolver_runlines while the table doesn't exist. Fixed directly in the PR (mirroring PH1.1's #57 precedent) rather than leave a regression; traceability issue at #67.api/metrics.pyitself needed no change.