I have "customers", "products" and "versions" tables.Each customer, can have more than one product, and each product has more than one version. I have created many-to-many relation "customers_products" and everything works perfect.
Also I have created one-to-many relation between "products" and "versions".
QUESTION: How to add an extra column (version_id) in "customers_products" table so I can build form where user can choose products and version to create new customer.
Once an association has data, it's no more an association.
You have to implement two ManyToOne
instead of a ManyToMany
.
See this great answer on this question for a full example.
You can get a lot of other examples by googling the title of your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With