From 8449a0f958ddcf547c3958c29db2128c20988abc Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sat, 28 Jan 2023 12:40:46 +0100 Subject: [PATCH] Fix DraftDao queries on older SQLite (#3231) --- app/src/main/java/com/keylesspalace/tusky/db/DraftDao.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/db/DraftDao.kt b/app/src/main/java/com/keylesspalace/tusky/db/DraftDao.kt index 66317224..7b1f62b8 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/DraftDao.kt +++ b/app/src/main/java/com/keylesspalace/tusky/db/DraftDao.kt @@ -31,10 +31,10 @@ interface DraftDao { @Query("SELECT * FROM DraftEntity WHERE accountId = :accountId ORDER BY id ASC") fun draftsPagingSource(accountId: Long): PagingSource - @Query("SELECT COUNT(*) FROM DraftEntity where accountId = :accountId and failedToSendNew=true") + @Query("SELECT COUNT(*) FROM DraftEntity WHERE accountId = :accountId AND failedToSendNew = 1") fun draftsNeedUserAlert(accountId: Long): LiveData - @Query("UPDATE DraftEntity SET failedToSendNew=false where accountId = :accountId and failedToSendNew=true") + @Query("UPDATE DraftEntity SET failedToSendNew = 0 WHERE accountId = :accountId AND failedToSendNew = 1") suspend fun draftsClearNeedUserAlert(accountId: Long) @Query("SELECT * FROM DraftEntity WHERE accountId = :accountId")