Skip to content

About migration test #1967

Answered by simolus3
jack24254029 asked this question in Q&A
Discussion options

You must be logged in to vote

The schemaVersion getter of a database returns the latest schema known to the database class. So in your case, you have something like @override int get schemaVersion => 3 in your code, and that is the one that gets returned in the test.

To make the migration test as realistic as possible, drift uses your regular database class without any modifications, there's no magic being done to the Database class you've written. The only difference is that, inside a schema test, the to parameter of your onUpgrade callback is set to the schema version your test is migrating to.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jack24254029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants