mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-03 23:56:07 +02:00
Reduce number of invalidations
This commit is contained in:
@@ -54,7 +54,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
|
||||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 86,
|
||||
version = 87,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
@@ -68,7 +68,10 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
|
||||
EntityLog.class
|
||||
},
|
||||
views = {
|
||||
EntityFolderView.class
|
||||
EntityAccountProp.class,
|
||||
EntityFolderProp.class,
|
||||
EntityAttachmentProp.class,
|
||||
EntityOperationProp.class
|
||||
}
|
||||
)
|
||||
|
||||
@@ -863,6 +866,21 @@ public abstract class DB extends RoomDatabase {
|
||||
db.execSQL("CREATE VIEW `folderview` AS SELECT id, account, name, type, display, unified FROM folder");
|
||||
}
|
||||
})
|
||||
.addMigrations(new Migration(86, 87) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase db) {
|
||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("DROP VIEW `folderview`");
|
||||
db.execSQL("CREATE VIEW `accountprop` AS " +
|
||||
"SELECT id, name, color, synchronize, `primary`, notify, browse, swipe_left, swipe_right, created, `order` FROM account");
|
||||
db.execSQL("CREATE VIEW `folderprop` AS " +
|
||||
"SELECT id, account, name, type, download, display, unified, notify FROM folder");
|
||||
db.execSQL("CREATE VIEW `attachmentprop` AS " +
|
||||
"SELECT id, message, name FROM attachment");
|
||||
db.execSQL("CREATE VIEW `operationprop` AS " +
|
||||
"SELECT id, folder, message, name FROM operation");
|
||||
}
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user