【发布时间】:2019-07-15 05:22:54
【问题描述】:
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() 是否总是在迁移时删除数据库?还是只有在迁移失败时才删除?
【问题讨论】:
-
当您更改领域类结构时,它会删除架构。
-
@RajasekaranM 谢谢。如果您发布答案,我会将其标记为已接受。
标签: android realm realm-migration