Defer downloading body

This commit is contained in:
M66B
2018-09-15 07:22:42 +00:00
parent 9c92f19127
commit 87ead339f9
10 changed files with 1035 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 15,
version = 16,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -221,6 +221,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("CREATE UNIQUE INDEX `index_attachment_message_cid` ON `attachment` (`message`, `cid`)");
}
})
.addMigrations(new Migration(15, 16) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `message` ADD COLUMN `downloaded` INTEGER NOT NULL DEFAULT 1");
}
})
.build();
}