https://realm.io/docs/javascript/latest/#opening-realms 领域文档说
deleteRealmIfMigrationNeeded: delete the Realm if migration is needed; this is useful under development since the data model might change often
在RealmConfiguration.java
中,
* Setting this will change the behavior of how migration exceptions are handled. Instead of throwing a
* {@link io.realm.exceptions.RealmMigrationNeededException} the on-disc Realm will be cleared and recreated
* with the new Realm schema.
所以我的问题是,deleteRealmIfMigrationNeeded()
总是在迁移时删除数据库吗?还是仅在迁移失败时将其删除?
答案 0 :(得分:0)
deleteRealmIfMigrationNeeded()
将在您更改领域类结构时删除应用程序架构。否则,它不会删除您的架构。