Files
drift/examples/migrations_example
2025-08-17 16:11:07 +02:00
..
2025-06-25 20:59:38 -04:00
2022-08-13 23:33:05 +02:00
2025-06-25 20:59:38 -04:00
2025-08-17 16:11:07 +02:00
2024-10-10 22:15:01 +02:00

Example to demonstrate tests for schema migrations.

See test/migration_test.dart on how to use the generated verification code.

Workflow

Schema changes

After adapting a schema and incrementing the schemaVersion in the database, run

dart run drift_dev make-migrations

Testing

Write the migration using the step-by-step migration helper. To verify the migration, run the tests.

dart test

To test a specific migration, use the -N flag with the migration name.

dart test -N "v1 to v2"