Skip to content

Renaming an old column causes error in the previous migration code used for adding that old column #3151

Closed Answered by simolus3
cal-g asked this question in Q&A
Discussion options

You must be logged in to vote

This is another thing that would be much easier with schema migration helpers, which give you a snapshot of all previous schemas in your apps (so you can do from1To2: (m, schema) async { await m.addColumn(schema.todos, schema.todos.dueDate); } without ever having to change your code).
If you can still migrate to these helpers by running dart run drift_dev schema dump at different git revisions of your app, that may be worth it just to solve these kinds of issues. It also lets you unit test you migrations. We will point out this feature more strongly on the docs soon.

Maybe the previous migration code needs some adjustment ?

The only thing that comes to mind unfortunately is to use custo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cal-g
Comment options

Answer selected by cal-g
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