Improved composing with signature, replying/forwarding

This commit is contained in:
M66B
2018-11-16 13:48:45 +01:00
parent e18db5c812
commit d3966263c1
7 changed files with 1246 additions and 60 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 = 3,
version = 4,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -138,6 +138,15 @@ public abstract class DB extends RoomDatabase {
" (SELECT account.signature FROM account WHERE account.id = identity.account)");
}
})
.addMigrations(new Migration(3, 4) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `message` ADD COLUMN `forwarding` INTEGER" +
" REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL");
db.execSQL("CREATE INDEX `index_message_forwarding` ON `message` (`forwarding`)");
}
})
.build();
}