Hi,
I’m having a strange problem with a MANY_MANY relationship on 2 AR models.
I have a Note model which is related to a Person model through the table note_participant. The note_participant table has foreign key constraints joining it to both the person and note tables
The relationship in Person is defined like this:
'notes' => [
self::MANY_MANY,
'Note',
'note_participant(person_id, note_id)'
]
and it works fine. The problem is that the reverse relationship in Note is throwing this error message
The relation "participants" in active record class "Note" is specified with an incomplete foreign key. The foreign key must consist of columns referencing both joining tables.
its defined like this:
'participants' => [
self::MANY_MANY,
'Person',
'note_participant(note_id, person_id)'
]
Any ideas why this could be happening?
Thanks for any help