Merge branch 'store-fix-migration' into 'master'

[Store] Fix db migration

See merge request famedly/famedlysdk!63
This commit is contained in:
Christian 2019-08-06 08:47:03 +00:00
commit d02ba91c4e

View file

@ -64,11 +64,11 @@ class Store {
"[Store] Migrate databse from version $oldVersion to $newVersion"); "[Store] Migrate databse from version $oldVersion to $newVersion");
if (oldVersion != newVersion) { if (oldVersion != newVersion) {
await schemes.forEach((String name, String scheme) async { 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 createTables(db);
await db.rawUpdate("UPDATE Clients SET prev_batch='' WHERE client=?",
[client.clientName]);
} }
}); });