Skip to content

How can I manually run migrations? #1065

Discussion options

You must be logged in to vote

Migrations are run when the schema version of the database file in the device differs from the one that is passed when the db is opened. In the case of moor is through the getter in the AppDatabase file.
You could create a constructor for the database that receives a specific version. Then you can simply close and reopen the database to trigger the migrations

Replies: 1 comment 19 replies

Comment options

You must be logged in to vote
19 replies
@MiguelSOliveira
Comment options

@davidmartos96
Comment options

@davidmartos96
Comment options

@MiguelSOliveira
Comment options

@davidmartos96
Comment options

Answer selected by MiguelSOliveira
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