Summary
The Drift database schema is version 3, but the migration strategy only handles upgrades from version 1. There is no explicit path for users upgrading from version 2 to version 3.
Evidence
- File:
lib/core/database/database.dart
schemaVersion => 3.
onUpgrade checks only if (from == 1) and creates preparationSchedules and preparationUsers.
- No migration branch handles
from == 2 or validates intermediate migrations.
Why this is not production ready
- Existing users can hit failed or incomplete local database migrations after app update.
- Local schedule/preparation data may become unavailable or corrupted.
- Migration bugs often appear only after release on real user devices.
Scope
Create complete, tested Drift migrations for all supported schema upgrade paths.
Suggested implementation
- Determine what changed between schema versions 1, 2, and 3.
- Implement stepwise migrations for
1 -> 2, 2 -> 3, and 1 -> 3 as appropriate.
- Add migration tests with old schema fixtures or
Migrator verification.
- Confirm web Drift storage behavior if web persistence is supported.
Acceptance criteria
- Upgrades from every supported previous schema version to current schema succeed.
- Migration tests cover all expected upgrade paths.
- Foreign keys remain enabled after migration.
- Existing local data is preserved or intentionally transformed with documentation.
Project priority
P0 - User data safety blocker.
Summary
The Drift database schema is version
3, but the migration strategy only handles upgrades from version1. There is no explicit path for users upgrading from version2to version3.Evidence
lib/core/database/database.dartschemaVersion => 3.onUpgradechecks onlyif (from == 1)and createspreparationSchedulesandpreparationUsers.from == 2or validates intermediate migrations.Why this is not production ready
Scope
Create complete, tested Drift migrations for all supported schema upgrade paths.
Suggested implementation
1 -> 2,2 -> 3, and1 -> 3as appropriate.Migratorverification.Acceptance criteria
Project priority
P0 - User data safety blocker.