feat(schedule): add PostgreSQL and SQLite storage - #191
Conversation
# Conflicts: # frontend/src/features/schedule/application/scheduleClientService.ts # frontend/tests/scheduleContracts.test-d.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| updated_at, deleted_at | ||
| ) | ||
| SELECT | ||
| left(id, 64), |
There was a problem hiding this comment.
[P1] Preserve legacy identifiers during migration
left(id, 64) silently truncates the legacy primary key before inserting it into the new table. The old column is unbounded Text, so any existing identifier longer than 64 characters is changed, and two IDs sharing the first 64 characters will collide and abort the migration. Please validate/reject overlong IDs or migrate the full value rather than truncating it (the same concern applies to user_id on the next line).
| OR (schedule_type = 'time' AND start_time IS NOT NULL AND end_time IS NOT NULL) | ||
| ), | ||
| CHECK ( | ||
| (reminder_type IS NULL |
There was a problem hiding this comment.
[P1] Require disposition state to be absent without a reminder
The cloud Schedule constraint requires reminder_disposition_state to be NULL whenever reminder_type is NULL, but this local presence check omits that column from the first branch. SQLite therefore accepts rows with no reminder configuration and a confirmed/snoozed disposition, creating a local state that cannot satisfy the backend schema. Include reminder_disposition_state IS NULL in this branch to keep the two storage contracts aligned.
|
This combined PR has been split into smaller, independently reviewable changes:
Closing this PR in favor of those two replacements. |
Summary
schedulesandschedule_occurrence_overridesstorage with the v3.10 schedule contractsconfirmeddisposition separate from the client-onlysnoozedstateVerification
uv run ruff check .uv run ruff format --check .uv run mypyuv run pytest(79 passed)uv run alembic headsnpm run lintnpm run typechecknpx prettier --check .npx expo export --platform android --output-dir distScope
This PR only adds PostgreSQL and SQLite persistence foundations. It does not implement the five Agent business operations, RRULE expansion, recurring deletion behavior, stale snapshot decisions, or snapshot transaction orchestration.
account_idis non-null, indexed, and enforced by repository queries. Its physical foreign key is deferred until the sharedaccountstable migration lands.