MrR*_*Red 4 migration android realm
好的,所以我有一个比Coin领域对象还多的应用程序。我现在正在升级我的应用程序,并将多个新字段添加到现有的Coin对象。到目前为止一切顺利,但是我该如何迁移LinkingObject,RealmResults类型。linkedPortfolioCoins是我想要迁移的
public class Coin extends RealmObject {
//a bunch of other fields here
@LinkingObjects("coin")
private final RealmResults<PortfolioCoin> linkedPortfolioCoins = null;
}
Run Code Online (Sandbox Code Playgroud)
而且,只有
.addRealmListField
Run Code Online (Sandbox Code Playgroud)
我认为可以代替RealmResults使用,但是如何使它成为Coin的LinkingObject。
我得到的错误是
Caused by: io.realm.exceptions.RealmMigrationNeededException: Field count is more than expected - expected 18 but was 19
Run Code Online (Sandbox Code Playgroud)
确定只是为了将来帮助任何人。看来您不必迁移链接对象。通过不迁移链接的PortfolioCoins并将其遗漏而使其起作用。那也可以解释我的错误:)
| 归档时间: |
|
| 查看次数: |
469 次 |
| 最近记录: |