New RealmModel migration issue with Realm

3.2k views Asked by At

for the first I need to update the schema of one of my apps, so I created a new RealmModel. This model is isolated from the other tables, so there are no modifications on the old schema, just a new table. The problem is that even if I try to do the migration an exception is thrown telling me that xxModel class is missing from the schema for this realm. The xxModel is not the new one, but an older one. What am I missing? What is the procedure when you add a new table in realm schema? The new model contains just some strings and integers btw.

Thank you.

1

There are 1 answers

1
Emanuelez On

we actually handle this particular case in our migration example and you can see here how we handle migrating from version 1 to 2 as we add a Pet model class:

https://github.com/realm/realm-java/blob/master/examples/migrationExample/src/main/java/io/realm/examples/realmmigrationexample/model/Migration.java

I hope this helps! :)