I am getting this error while running program with Room Database
Room cannot verify the data integrity. Looks like you\'ve changed schema but forgot to updat
By default Android manifest have android:allowBackup="true", Which allow apps to persist their SQLite DB on reinstallation.
Suppose your DATABASE_VERSION was initially 3 and then you decide to reduce DB version from 3 to 1.
@Database(entities = {CallRecording.class}, version = DATABASE_VERSION)
public abstract class AppDatabase extends RoomDatabase {
public abstract RecordingDAO recordingDAO();
// static final Migration MIGRATION_1_2 = new Migration(1, 2) {
// @Override
// public void migrate(SupportSQLiteDatabase database) {
// // Since we didn't alter the table, there's nothing else to do here.
// }
// };
}
You can achieve it like this
Its a good practise to keep DATABASE_VERSION as constant.