Added realm

This commit is contained in:
M66B
2019-01-10 18:24:20 +00:00
parent 821178754d
commit 373251f535
16 changed files with 1426 additions and 24 deletions

View File

@@ -49,7 +49,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 32,
version = 33,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -404,6 +404,14 @@ public abstract class DB extends RoomDatabase {
db.execSQL("CREATE INDEX `index_message_ui_snoozed` ON `message` (`ui_snoozed`)");
}
})
.addMigrations(new Migration(32, 33) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("ALTER TABLE `account` ADD COLUMN `realm` TEXT");
db.execSQL("ALTER TABLE `identity` ADD COLUMN `realm` TEXT");
}
})
.build();
}