drift/extras/migrations_example
westito fad654a5aa
PostgreSQL support (#1507)
Support PostgreSQL as a dialect in the main package and with an implementation provided in another package.

Co-authored-by: Simon Binder <oss@simonbinder.eu>
2021-11-11 14:40:41 +01:00
..
drift_migrations Accept drift-named schema files 2021-10-14 21:44:44 +02:00
lib PostgreSQL support (#1507) 2021-11-11 14:40:41 +01:00
test Accept drift-named schema files 2021-10-14 21:44:44 +02:00
README.md Migrate migration example to drift 2021-10-09 17:10:34 +02: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 moor_migrations/ test/generated/ --data-classes --companions