Skip to content

Repository files navigation

drift_db_example

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.

Project structure

  • packages/database/ — a dart-only Drift database package (schema, generated code, migrations, tests).
  • lib/ — a Flutter app that uses the database package.

Migration docs (docs/)

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/.

Quick start (local)

flutter pub get

cd packages/database
make get
make gen
make db_migrate

If you’re interested specifically in migrations, start from the runbooks in packages/database/docs/migrations/.

About

Example Flutter + Drift project focused on safe, testable database migrations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages