0

I have a published iOS app that is using a Realm database and I need to add a new class to the database and I need to preserve user data. Not sure how to proceed with the migration.

The Realm documents describe how to add a new variable with the migration code, but I am not sure how to add an entire class to the database.

I have also changed the main variable from var register:Results? To var register:List? And I am not sure if this needs to be migrated too.

I would appreciate any insights.

Thanks!

Blessings, —Mark

1 Answer 1

4

Since no one was able to help me, I finally discovered that adding another model/class does not require Migration. Only a change to the existing model will require Migration.

Changes in code do not need migration, but they DO change how the application will behave with data saved previously. I am still working on that!

Hope this helps others who are learning to use Realm. Blessings, —Mark

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.