Reputation: 9646
I'm currently in the process of writing an app that uses Realm as a database. As I'm still writing it my models have invariably changed from what I initially designed. Unfortunately every time this happens I need to update a migration block.
Is there anyway to 'reset' my Realm so that until it's actual in 'production' I don't need to worry about Migration blocks at all? It's particularly a pain with some unit tests, I do actually delete all the tables when the tests run, but I'm assuming there must be a best practice to handle this
Specifically I am working in an iOS/Swift app.
Upvotes: 3
Views: 2204
Reputation: 161
Yes, there is very useful solution, just type:
var config = Realm.Configuration()
config.deleteRealmIfMigrationNeeded = true
Upvotes: 5