Improve migration guidelines

This commit is contained in:
Mathieu Pierfitte 2022-02-09 14:13:45 +01:00 committed by GitHub
parent 1ced978f86
commit 6113bb3dc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -36,11 +36,11 @@ We can now change the `database` class like this:
},
onUpgrade: (Migrator m, int from, int to) async {
if (from < 2) {
// we added the dueDate property in the change from version 1
// we added the dueDate property in the change from version 1 to version 2
await m.addColumn(todos, todos.dueDate);
}
if (from < 3) {
// we added the priority property in the change from version 2
// we added the priority property in the change from versions 1 or 2 to version 3
await m.addColumn(todos, todos.priority);
}
}