drift/extras/migrations_example
westito d22bbcbadf Merge remote-tracking branch 'simolus3/develop' into views 2021-12-02 09:20:02 +01:00
..
drift_migrations Accept drift-named schema files 2021-10-14 21:44:44 +02:00
lib Regenerate files 2021-11-30 22:23:35 +01:00
test Accept drift-named schema files 2021-10-14 21:44:44 +02:00
README.md Fix schema verifier around virtual tables 2021-12-01 21:07:47 +01:00
analysis_options.yaml Adapt excludes in analysis options 2021-05-15 10:42:15 +02:00
build.yaml Migrate migration example to drift 2021-10-09 17:10:34 +02:00
pubspec.yaml Migrate migration example to drift 2021-10-09 17:10:34 +02:00

README.md

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 schema dump lib/database.dart moor_migrations/moor_schema_v2.json

Replace _v2 with the current schemaVersion.

Generating test code

Run

dart run drift_dev schema generate drift_migrations/ test/generated/ --data-classes --companions