Merge branch 'mini_fixes4' into 'master'

[Store] Add missing comma

See merge request famedly/famedlysdk!38
This commit is contained in:
Christian 2019-07-18 18:07:59 +00:00
commit e4d9113ed8

View file

@ -624,16 +624,19 @@ class Store {
} }
Future forgetNotification(String roomID) async { Future forgetNotification(String roomID) async {
await db.rawDelete("DELETE FROM NotificationsCache WHERE chat_id=?", [roomID]); await db
.rawDelete("DELETE FROM NotificationsCache WHERE chat_id=?", [roomID]);
return; return;
} }
Future addNotification(String roomID, String event_id, int uniqueID) async { Future addNotification(String roomID, String event_id, int uniqueID) async {
await db.rawInsert("INSERT INTO NotificationsCache VALUES (?, ?,?)", [uniqueID, roomID, event_id]); await db.rawInsert("INSERT INTO NotificationsCache VALUES (?, ?,?)",
[uniqueID, roomID, event_id]);
return; return;
} }
Future<List<Map<String, dynamic>>> getNotificationByRoom(String room_id) async { Future<List<Map<String, dynamic>>> getNotificationByRoom(
String room_id) async {
List<Map<String, dynamic>> res = await db.rawQuery( List<Map<String, dynamic>> res = await db.rawQuery(
"SELECT * FROM NotificationsCache WHERE chat_id=?", [room_id]); "SELECT * FROM NotificationsCache WHERE chat_id=?", [room_id]);
if (res.length == 0) return null; if (res.length == 0) return null;
@ -717,9 +720,10 @@ class Store {
'UNIQUE(chat_id, matrix_id))'; 'UNIQUE(chat_id, matrix_id))';
/// The database scheme for the NotificationsCache class. /// The database scheme for the NotificationsCache class.
static final String NotificationsCacheScheme = 'CREATE TABLE IF NOT EXISTS NotificationsCache(' + static final String NotificationsCacheScheme =
'id int PRIMARY KEY' 'CREATE TABLE IF NOT EXISTS NotificationsCache(' +
'chat_id TEXT, ' + // The chat id 'id int PRIMARY KEY, ' +
'event_id TEXT, ' + // The matrix id of the Event 'chat_id TEXT, ' + // The chat id
'UNIQUE(event_id))'; 'event_id TEXT, ' + // The matrix id of the Event
'UNIQUE(event_id))';
} }