From 9d5296d4e01b12d0bde300dba2031f0189d569f2 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 26 Jul 2019 11:00:39 +0200 Subject: [PATCH] [Store] Wait for table creation --- lib/src/Store.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/Store.dart b/lib/src/Store.dart index 066830d3..9259ad46 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -55,7 +55,7 @@ class Store { _init() async { var databasePath = await getDatabasesPath(); String path = p.join(databasePath, "FluffyMatrix.db"); - _db = await openDatabase(path, version: 9, + _db = await openDatabase(path, version: 8, onCreate: (Database db, int version) async { await createTables(db); }, onUpgrade: (Database db, int oldVersion, int newVersion) async { @@ -69,7 +69,7 @@ class Store { await db.execute("DROP TABLE IF EXISTS NotificationsCache"); db.rawUpdate("UPDATE Clients SET prev_batch='' WHERE client=?", [client.clientName]); - createTables(db); + await createTables(db); } });