A lost feature from Core Data seems to be the ability to enforce a uniqueness constraint based on multiple attributes. For example, with Core Data one could have a constraint for “firstName,lastName” and only the combination of the same firstName and lastName was enforced to be unique. In SwiftData there seems to be no way to achieve this with the @Attribute(.unique) macro.
It seems that the only solution would be to create a name-mangled composite attribute and automatically update that on insert, but this should be a feature of SwiftData. If I'm missing something please let me know.
The relevant entity attribute from an xcdatamodeld file is:
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="firstName"/>
<constraint value="lastName"/>
</uniquenessConstraint>
</uniquenessConstraints>
I filed this as feedback FB12385087