I have a many-to-many relationship between two tables: Order and Item. I need to save an extra information on this relationship, the quantity.
So, I have to create an extra table in my model .xcdatamodel?
In the following schema, both orderItems are to-many relationship to OrderItem table. order & item are inverse relationship.
Order (start, end, orderItems)
Item (name, orderItems)
OrderItem (quantity, order, item)
Edited:
So according to Randy, is this what you suggest?
Order (start, end, orderItems)
Item (name, quantity, orders)
orderItems points to Item as a to-many relationship, the inverse relationshipo is orders, orders points to Order as a to-many relationship
There is no need to create an additional table. It’s acceptable to have a M2M association table that contains columns other than the FK references to the two tables. Sometimes an additional column in the M2M association table makes perfect sense.