mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Faster database access
This commit is contained in:
@@ -41,7 +41,7 @@ import android.util.Log;
|
||||
EntityAttachment.class,
|
||||
EntityOperation.class
|
||||
},
|
||||
version = 4,
|
||||
version = 5,
|
||||
exportSchema = true
|
||||
)
|
||||
|
||||
@@ -78,6 +78,7 @@ public abstract class DB extends RoomDatabase {
|
||||
.addMigrations(MIGRATION_1_2)
|
||||
.addMigrations(MIGRATION_2_3)
|
||||
.addMigrations(MIGRATION_3_4)
|
||||
.addMigrations(MIGRATION_4_5)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -109,7 +110,15 @@ public abstract class DB extends RoomDatabase {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase db) {
|
||||
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("CREATE INDEX `index_message_ui_seen` ON `message` (`ui_seen`)");
|
||||
db.execSQL("CREATE INDEX `index_message_ui_seen` ON `message` (`ui_seen`)");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Migration MIGRATION_4_5 = new Migration(4, 5) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase db) {
|
||||
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("CREATE INDEX `index_message_ui_hide` ON `message` (`ui_hide`)");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user