Ok so i have an app than had a Coin realm object. I am now upgrading my app, and adding multiple new fields to the existing Coin object. So far so good, but how do i migrate a LinkingObject, RealmResults type. linkedPortfolioCoins is what i want to migrate
public class Coin extends RealmObject {
//a bunch of other fields here
@LinkingObjects("coin")
private final RealmResults<PortfolioCoin> linkedPortfolioCoins = null;
}
Also, There is only
.addRealmListField
Which i assume will be ok instead of RealmResults, but how do i make it a LinkingObject to Coin.
The error im getting is
Caused by: io.realm.exceptions.RealmMigrationNeededException: Field count is more than expected - expected 18 but was 19
Ok just to help anyone in future. It appears you dont have to migrate linking objects. Got it working by just not migrating the linkedPortfolioCoins and leaving it out. That would also explain my error :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With