Model the whole domain: settings, the reference week, dated exceptions,
vacation periods, the public-holiday cache, display messages, the
translation cache, the audit log, and the device tables the BYOS server
needs (Device, DeviceLog, SyncState).
Two modelling decisions are load-bearing and documented in the schema:
- Opening times are wall-clock "HH:mm" strings in the shop timezone,
never instants. Nothing is stored in UTC, which turns the March and
October daylight-saving switches into non-events instead of edge cases.
- VacationPeriod is a source of truth, never expanded into
ScheduleException rows. The resolver reads it directly at priority
rank 2, so a holiday sync can never overwrite a manual exception and
editing a period leaves no orphans behind.
Device access tokens are stored only as SHA-256 digests, and the image
filename column holds a content hash: the firmware skips the redraw when
the filename is unchanged, which is where the battery life comes from.
Prisma 7 no longer accepts the connection URL in the schema file, so it
moves to prisma.config.ts with the pg driver adapter.
The dev Postgres service lands here rather than with the rest of the
Docker work, because the migration needs a database to run against.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012cSY9pVhZmJUKNN7wf1Myd