Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • R ReActiveAndroid
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mahach Imangazaliev
  • ReActiveAndroid
  • Issues
  • #60
Closed
Open
Issue created May 07, 2019 by nscherer@nscherer

Data integrity crash

ReActiveAndroid Version: 1.4.3

Bug or Feature Request: Got a data integrity crash after updating data model and database version

Description:

java.lang.IllegalStateException: ReActiveAndroid cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number.
        at com.reactiveandroid.internal.database.ReActiveOpenHelper.checkIdentity(ReActiveOpenHelper.java:71)
        at com.reactiveandroid.internal.database.ReActiveOpenHelper.onOpen(ReActiveOpenHelper.java:51)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:411)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:298)
        at com.reactiveandroid.internal.database.DatabaseInfo.getWritableDatabase(DatabaseInfo.java:65)
        at com.reactiveandroid.ReActiveAndroid.getWritableDatabaseForTable(ReActiveAndroid.java:131)
        at com.reactiveandroid.internal.utils.QueryUtils.execSQL(QueryUtils.java:27)
        at com.reactiveandroid.query.ExecutableQueryBase.execute(ExecutableQueryBase.java:21)

I deleted a field from my model, and incremented the database version:

@Database(name = "propertyforce", version = 19)
public class AppDatabase {

It was 18 before. Here's how I'm initializing:

DatabaseConfig appDatabase = new DatabaseConfig.Builder(AppDatabase.class)
                        .addModelClasses(LogEntry.class, FarmReport.class, FarmReportProperty.class)
                        .disableMigrationsChecking() // Potentially destructive, so replace with migrations if adding any tables that need to persist
                        .addTypeSerializers(JsonSerializer.class)
                        .build();
                ReActiveAndroid.init(new ReActiveConfig.Builder(context)
                        .addDatabaseConfigs(appDatabase)
                        .build());

So I shouldn't need any migrations. Why is this happening?

Assignee
Assign to
Time tracking