Fixed resetting folder types

This commit is contained in:
M66B
2019-02-02 11:50:57 +00:00
parent ba116353d9
commit 7e2479d138
3 changed files with 5 additions and 9 deletions

View File

@@ -69,11 +69,6 @@ public interface DaoFolder {
" GROUP BY folder.id")
LiveData<List<TupleFolderEx>> liveFolders(Long account);
@Query("SELECT * FROM folder" +
" WHERE (:account < 0 OR folder.account = :account)" +
" AND type <> '" + EntityFolder.USER + "'")
LiveData<List<EntityFolder>> liveSystemFolders(long account);
@Query("SELECT folder.*, account.name AS accountName, account.color AS accountColor, account.state AS accountState" +
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +
@@ -170,6 +165,7 @@ public interface DaoFolder {
@Query("UPDATE folder" +
" SET type = '" + EntityFolder.USER + "'" +
" WHERE account = :account" +
" AND type <> '" + EntityFolder.INBOX + "'" +
" AND type <> '" + EntityFolder.SYSTEM + "'")
int setFoldersUser(long account);