Select folders to show in unified inbox

Fixed #47
Fixes #87
This commit is contained in:
M66B
2018-09-05 09:41:16 +00:00
parent 82d2c7e03a
commit 1e7ff72e55
13 changed files with 1005 additions and 11 deletions

View File

@@ -45,7 +45,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 9,
version = 10,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -175,6 +175,15 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `message` ADD COLUMN `headers` 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 `folder` ADD COLUMN `unified` INTEGER NOT NULL DEFAULT 0");
db.execSQL("CREATE INDEX `index_folder_unified` ON `folder` (`unified`)");
db.execSQL("UPDATE `folder` SET unified = 1 WHERE type = '" + EntityFolder.INBOX + "'");
}
})
.build();
}