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 |
---|---|---|---|
Failed to open Realm file at path ‘…/CustomName.realm’: Operation not permitted. Please use a path where your app has read-write permissions. | 4 | 1.0k | May 2024 |
Realm macOS SwiftUI Getting Started | 0 | 347 | Jun 2024 |
Realm unconfirmed user login error | 4 | 572 | Aug 2024 |
How to extend a Realm Class inside any other class in Flutter? | 0 | 277 | Jul 2024 |
I’m looking for samples on querying Realm through RealmStudio | 4 | 558 | Jul 2024 |