I have a Realm model that I want to apply migrations. However, when I apply the migrations I get the error
Configurations cannot be different if used to open the same file.
The most likely cause is that equals() and hashCode() are not overridden in the migration class:
In my Activity class, the configuration is set as:
realmConfiguration = new RealmConfiguration
.Builder(this)
.schemaVersion(0)
.migration(new Migration())
.build();
I use the realm instance to get some values. And then I apply the migration using:
RealmConfiguration config = new RealmConfiguration.Builder(this)
.schemaVersion(1) // Must be bumped when the schema changes
.migration(new Migration()) // Migration to run
.build();
Realm.setDefaultConfiguration(config);
When I call this: realm = Realm.getDefaultInstance();
I get the error above. Am I applying the migrations correctly?