I need help for resolving CrossTableLinkTarget exception

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