Identity colors

This commit is contained in:
M66B
2018-11-10 16:47:11 +00:00
parent bb7c730936
commit b6c651126d
10 changed files with 1225 additions and 20 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 = 26,
version = 27,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -307,6 +307,14 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `message` ADD COLUMN `extra` TEXT");
}
})
.addMigrations(new Migration(26, 27) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i(Helper.TAG, "DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `identity` ADD COLUMN `color` INTEGER");
db.execSQL("CREATE INDEX `index_identity_account_email` ON `identity` (`account`, `email`)");
}
})
.build();
}