Add duration_minutes field to schedule blocks
Separates "recommended time" (time_start/time_end) from actual timer duration. If duration_minutes is set, the timer counts down from that value; otherwise falls back to the time_start–time_end window. - ScheduleBlock model: add nullable duration_minutes INT column - Startup migration: idempotent ADD COLUMN for existing DBs - Schemas: duration_minutes in create, update, and out - TimerDisplay: prefer duration_minutes * 60 over time diff when set - Admin block forms: Duration (min) input on add and edit forms Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ async def lifespan(app: FastAPI):
|
||||
# Idempotent column additions for schema migrations
|
||||
await _add_column_if_missing(conn, "schedule_templates", "day_start_time", "TIME NULL")
|
||||
await _add_column_if_missing(conn, "schedule_templates", "day_end_time", "TIME NULL")
|
||||
await _add_column_if_missing(conn, "schedule_blocks", "duration_minutes", "INT NULL")
|
||||
yield
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user