|
|
@ -68,7 +68,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
|
|
|
|
// https://developer.android.com/topic/libraries/architecture/room.html
|
|
|
|
// https://developer.android.com/topic/libraries/architecture/room.html
|
|
|
|
|
|
|
|
|
|
|
|
@Database(
|
|
|
|
@Database(
|
|
|
|
version = 213,
|
|
|
|
version = 214,
|
|
|
|
entities = {
|
|
|
|
entities = {
|
|
|
|
EntityIdentity.class,
|
|
|
|
EntityIdentity.class,
|
|
|
|
EntityAccount.class,
|
|
|
|
EntityAccount.class,
|
|
|
@ -2175,6 +2175,15 @@ public abstract class DB extends RoomDatabase {
|
|
|
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
|
|
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
|
|
|
db.execSQL("ALTER TABLE `account` ADD COLUMN `category` TEXT");
|
|
|
|
db.execSQL("ALTER TABLE `account` ADD COLUMN `category` TEXT");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}).addMigrations(new Migration(213, 214) {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
|
|
|
|
|
|
|
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
|
|
|
|
|
|
|
db.execSQL("CREATE INDEX `index_account_synchronize` ON `account` (`synchronize`)");
|
|
|
|
|
|
|
|
db.execSQL("CREATE INDEX `index_account_category` ON `account` (`category`)");
|
|
|
|
|
|
|
|
db.execSQL("DROP VIEW `account_view`");
|
|
|
|
|
|
|
|
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " + TupleAccountView.query);
|
|
|
|
|
|
|
|
}
|
|
|
|
}).addMigrations(new Migration(998, 999) {
|
|
|
|
}).addMigrations(new Migration(998, 999) {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
|
|
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
|
|
|