Keep browsed messages

This commit is contained in:
M66B
2018-11-26 16:57:00 +01:00
parent 8d4f8ce225
commit 3dabbbb677
7 changed files with 1211 additions and 19 deletions

View File

@@ -46,7 +46,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 9,
version = 10,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -184,6 +184,14 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `folder` ADD COLUMN `keywords` TEXT");
}
})
.addMigrations(new Migration(9, 10) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `message` ADD COLUMN `ui_browsed` INTEGER NOT NULL DEFAULT 0");
db.execSQL("CREATE INDEX `index_message_ui_browsed` ON `message` (`ui_browsed`)");
}
})
.build();
}