Show threading count / outbox

pull/207/head
M66B 2 years ago
parent f4d6dcdada
commit f59a6ddf55

File diff suppressed because it is too large Load Diff

@ -71,7 +71,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 228,
version = 229,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -1617,7 +1617,8 @@ public abstract class DB extends RoomDatabase {
logMigration(startVersion, endVersion);
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " +
TupleAccountView.query.replace(", category", ""));
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " + TupleIdentityView.query);
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " +
TupleIdentityView.query.replace(", account", ""));
db.execSQL("CREATE VIEW IF NOT EXISTS `folder_view` AS " + TupleFolderView.query);
}
})
@ -2305,6 +2306,13 @@ public abstract class DB extends RoomDatabase {
logMigration(startVersion, endVersion);
db.execSQL("ALTER TABLE `contact` ADD COLUMN `group` TEXT");
}
}).addMigrations(new Migration(228, 229) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
logMigration(startVersion, endVersion);
db.execSQL("DROP VIEW IF EXISTS `identity_view`");
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " + TupleIdentityView.query);
}
}).addMigrations(new Migration(998, 999) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {

@ -163,7 +163,7 @@ public interface DaoMessage {
" LEFT JOIN identity_view AS identity ON identity.id = message.identity" +
" JOIN folder_view AS folder ON folder.id = message.folder" +
" JOIN folder_view AS f ON f.id = :folder" +
" WHERE (message.account = f.account OR " + is_outbox + ")" +
" WHERE (message.account = f.account OR message.account = identity.account OR " + is_outbox + ")" +
" AND (:threading OR folder.id = :folder)" +
" AND (NOT message.ui_hide OR :debug)" +
" AND (NOT :found OR message.ui_found = :found)" +

@ -30,7 +30,7 @@ import java.util.Objects;
value = TupleIdentityView.query
)
public class TupleIdentityView {
static final String query = "SELECT id, name, email, display, color, synchronize FROM identity";
static final String query = "SELECT id, name, email, account, display, color, synchronize FROM identity";
@NonNull
public Long id;
@ -38,6 +38,8 @@ public class TupleIdentityView {
public String name;
@NonNull
public String email;
@NonNull
public Long account;
public String display;
public Integer color;
@NonNull

Loading…
Cancel
Save