Merge branch 'store-fix-migration' into 'master'
[Store] Fix db migration See merge request famedly/famedlysdk!63
This commit is contained in:
commit
d02ba91c4e
|
@ -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]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue