Reputation: 10400
I have a requirement like below:
For setting this up, I have setup the model like
Department
relationships
name: employees
destination: Employee
optional:yes
to-many:yes
delete-rule:cascade
inverse-relationship: none
Employee
relationships
name: department
destination: Department
optional:NO
to-many:NO
delete-rule: No action
Thanks
Upvotes: 0
Views: 140
Reputation: 33339
Yes, you should almost always specify the inverse relationship according to apple's documentation. You've got the option of not doing so, but it should rarely be used.
I think there may be situations where your database can become corrupted if you don't create an inverse relationship, but I'm no expert.
Those two relationships should be inverse relationships of each other.
I'm not sure about the delete rule. Sorry.
EDIT: @jrturton's comment suggests your delete rule is fine.
Upvotes: 1