This is a database modeling question.
I normally model one-to-many with a standard parent-child table setup, and I normally model many-to-many with an association table between the 2 tables. In this one case, the current requirement calls for a one-to-many relationship. But the client was talking about some potential future requirements that would call for a many-to-many relationship.
So here are 2 implementation options:
- Model the database as one-to-many to meet current requirements. If future requirements call for many-to-many, then I would need to change the database structure and the application code.
- Model the database as many-to-many and have the application code limit the data to be one-to-many. If future requirements call for many-to-many, then I would just need to change the application code.
Changing database structure after the fact can be a bit of a pain in our application, but I might be introducing unnecessary complexity in the name of flexibility.
Which option would you choose and why?