From 744aa3267f8d141f2f6dffbf51e62d97dadc2dc7 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 6 Aug 2019 08:47:03 +0000 Subject: [PATCH] [Store] Fix db migration --- lib/src/Store.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/Store.dart b/lib/src/Store.dart index e66f413..0e79109 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -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]); } });