2

I only just noticed that each uniqueness constraint in CoreData can have multiple attributes (comma,separated,properties). I don't actually know what it does to have multiple attributes in one constraint though. Does it mean that if any of them are unique then the constraint is not broken? The Apple documentation is not particularly helpful:

Constraints: After adding attributes as shown in Configuring Attributes, optionally enter the name of an attribute (or comma-separated list of attributes) to serve as unique constraints on the entity.

A. L. Strine
  • 611
  • 1
  • 7
  • 23
  • I don't see anything special about this, it's like creating a unique index in a database on either one column or multiple columns. If it is multiple columns then it is the combination of values in those columns that needs to be unique. – Joakim Danielson May 24 '19 at 06:30
  • 2
    @Joakim Danielson I'm not familiar enough with databases yet to know that's how database uniquing constraints work. And based on the little knowledge I have, I've learned that making CoreData assumptions based on sql database knowledge can be very self-defeating and frustrating, so I wanted to ask before assuming and building around that assumption. If you put your answer in an answer, I will accept it. – A. L. Strine May 25 '19 at 16:41
  • Apparently the answer is given in [this post](https://developer.apple.com/forums/thread/130142). – Reinhard Männer Jul 28 '22 at 16:20

0 Answers0