Demo repository showing a practical workflow for schema migrations in Drift (SQLite) in a Flutter + Dart setup.
The goal is to keep migrations reproducible and reviewable by:
- versioning schema snapshots,
- generating migration scaffolding with
drift_dev make-migrations, - wiring upgrades via Drift’s
MigrationStrategy/stepByStep, - validating upgrades with tests.
packages/database/— a dart-only Drift database package (schema, generated code, migrations, tests).lib/— a Flutter app that uses the database package.
The migration runbooks live in packages/database/docs/.
They are meant to be read top-to-bottom as a step-by-step guide for each schema version:
- what changes in the schema,
- which files to touch,
- which commands to run (
make gen,make db_migrate), - how to verify with tests.
See: packages/database/docs/migrations/.
flutter pub get
cd packages/database
make get
make gen
make db_migrateIf you’re interested specifically in migrations, start from the runbooks in packages/database/docs/migrations/.