Add active_and_visible index on tasks

gtask_related_email
Alex Baker 5 years ago
parent f027836c0c
commit 3730500d25

File diff suppressed because it is too large Load Diff

@ -58,7 +58,7 @@ import org.tasks.notifications.NotificationDao;
CaldavAccount.class,
GoogleTaskAccount.class
},
version = 67)
version = 68)
public abstract class Database extends RoomDatabase {
public static final String NAME = "database";

@ -36,12 +36,14 @@ import org.tasks.data.Tag;
import org.tasks.time.DateTime;
import timber.log.Timber;
/**
* Data Model which represents a task users need to accomplish.
*
* @author Tim Su <tim@todoroo.com>
*/
@Entity(tableName = "tasks", indices = @Index(name = "t_rid", value = "remoteId", unique = true))
@Entity(
tableName = "tasks",
indices = {
@Index(name = "t_rid", value = "remoteId", unique = true),
@Index(
name = "active_and_visible",
value = {"completed", "deleted", "hideUntil"})
})
public class Task implements Parcelable {
// --- table and uri

@ -338,6 +338,15 @@ public class Migrations {
}
};
private static final Migration MIGRATION_67_68 =
new Migration(67, 68) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL(
"CREATE INDEX `active_and_visible` ON `tasks` (`completed`, `deleted`, `hideUntil`)");
}
};
public static final Migration[] MIGRATIONS =
new Migration[] {
MIGRATION_35_36,
@ -362,7 +371,8 @@ public class Migrations {
MIGRATION_63_64,
MIGRATION_64_65,
MIGRATION_65_66,
MIGRATION_66_67
MIGRATION_66_67,
MIGRATION_67_68
};
private static Migration NOOP(int from, int to) {

Loading…
Cancel
Save