1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-24 16:53:37 +00:00

Added index on subject, cleanup

This commit is contained in:
M66B 2019-03-05 13:38:05 +00:00
parent f9a41cfce5
commit 83f6150d24
3 changed files with 1552 additions and 10 deletions

File diff suppressed because it is too large Load diff

View file

@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 49,
version = 50,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -537,6 +537,15 @@ public abstract class DB extends RoomDatabase {
db.execSQL("CREATE INDEX `index_operation_name` ON `operation` (`name`)");
}
})
.addMigrations(new Migration(49, 50) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("DROP INDEX `index_message_replying`");
db.execSQL("DROP INDEX `index_message_forwarding`");
db.execSQL("CREATE INDEX `index_message_subject` ON `message` (`subject`)");
}
})
.build();
}

View file

@ -57,13 +57,12 @@ import static androidx.room.ForeignKey.SET_NULL;
@Index(value = {"account"}),
@Index(value = {"folder"}),
@Index(value = {"identity"}),
@Index(value = {"replying"}),
@Index(value = {"forwarding"}),
@Index(value = {"folder", "uid"}, unique = true),
@Index(value = {"msgid", "folder"}, unique = true),
@Index(value = {"thread"}),
@Index(value = {"sender"}),
@Index(value = {"received"}),
@Index(value = {"subject"}),
@Index(value = {"ui_seen"}),
@Index(value = {"ui_flagged"}),
@Index(value = {"ui_hide"}),