Use identity IP by default

This commit is contained in:
M66B
2019-02-28 16:05:55 +00:00
parent c8238ae1ae
commit 26290a693a
4 changed files with 1544 additions and 3 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 = 47,
version = 48,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -523,6 +523,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `identity` ADD COLUMN `use_ip` INTEGER NOT NULL DEFAULT 0");
}
})
.addMigrations(new Migration(47, 48) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("UPDATE `identity` SET use_ip = 1");
}
})
.build();
}