1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-18 21:28:54 +00:00

Refactoring

This commit is contained in:
M66B 2020-01-20 20:33:25 +01:00
parent d91a30293a
commit 4f636fb870

View file

@ -128,7 +128,7 @@ public abstract class DB extends RoomDatabase {
if (sInstance == null) {
Context acontext = context.getApplicationContext();
sInstance = migrate(acontext, getBuilder(acontext));
sInstance = migrate(acontext, getBuilder(acontext)).build();
sInstance.getInvalidationTracker().addObserver(new InvalidationTracker.Observer(
EntityAccount.TABLE_NAME,
@ -183,7 +183,7 @@ public abstract class DB extends RoomDatabase {
});
}
private static DB migrate(final Context context, RoomDatabase.Builder<DB> builder) {
private static RoomDatabase.Builder<DB> migrate(final Context context, RoomDatabase.Builder<DB> builder) {
// https://www.sqlite.org/lang_altertable.html
return builder
.addMigrations(new Migration(1, 2) {
@ -1270,8 +1270,7 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `message` ADD COLUMN `ui_encrypt` INTEGER");
db.execSQL("UPDATE `message` SET `ui_encrypt` = `encrypt`");
}
})
.build();
});
}
@Override