Answer the question
In order to leave comments, you need to log in
How to make multiple ManyToMany relationships between two entities?
There are two entities: Event and User . An Event can have multiple attendees and multiple hosts, all of whom are users. That is, we need two fields in a table with many-to-many relationships.
If you create entities using make:entity , then there is no problem. But as soon as I try to create a migration with make:migration an error occurs
[Doctrine\DBAL\Schema\SchemaException (20)]
The table with name 'event_user' already exists.
Answer the question
In order to leave comments, you need to log in
The question is removed. The error was in the table structure. Information about the user's role within the event should be stored separately, then there will be no problems with relationships.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question