[Store] Fix db migration

This commit is contained in:
Christian 2019-08-06 08:47:03 +00:00
parent 1758c2c126
commit 744aa3267f
1 changed files with 3 additions and 3 deletions

View File

@ -64,11 +64,11 @@ class Store {
"[Store] Migrate databse from version $oldVersion to $newVersion");
if (oldVersion != newVersion) {
await schemes.forEach((String name, String scheme) async {
await db.execute("DROP TABLE IF EXISTS $name");
if (name != "Clients") await db.execute("DROP TABLE IF EXISTS $name");
});
db.rawUpdate("UPDATE Clients SET prev_batch='' WHERE client=?",
[client.clientName]);
await createTables(db);
await db.rawUpdate("UPDATE Clients SET prev_batch='' WHERE client=?",
[client.clientName]);
}
});