Hello
I got CrossTableLinkTarget exception in migration.
When I try to data with `migration.deleteData(forType: “AModel”)``````
I use several realm files
and AModel is used for only one realmfile.
The description of the issue a bit vague - a Realm Migration is for one file only so not sure how having several Realm files plays into that.
The error CrossTableLinkTarget
I believe is thrown if you’re trying to a create a Realm but don’t have permission to do so. Never actually seen that error but per the documentation
// Thrown by functions that require a table to not be the target of link
// columns, unless those link columns are part of the table itself.
I think it can also happen if you try to reference a property on that same property. e.g. perhaps a query on a person object where @“name.name == %@”, “Jay” where name is a String. One of the reasons using type-safe syntax is important. May not be the case here but just sayin’
Do you have a small reproducible example of the code that throws the error and perhaps a model you can share?
In my case, CrossTableLInkTarker error was thrown when I trying delete data of Type
That type will be removed newest schemaversion, so I tried to delete unused data.
migration.deleteData(forType: “AModel”)
I will try to make reproducible example and then I will reply example code
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
Binary framework with RealmSwift | 0 | 421 | Jun 2024 |
SwiftUI: deselecting List element when adding object to @ObservedRealmObject | 1 | 467 | Jun 2024 |
Flutter App + Atlas App Services + Apollo | 0 | 299 | Jul 2024 |
Librealm_dart.dylib: No such file or directory | 3 | 304 | Aug 2024 |
Compiler error upgrading from Kotlin Realm SDK 1.16 to 2.x | 0 | 70 | Sep 2024 |