We have a situation where we appear to need to use two different M2M relationships between two entities in a database.
The entities are Users
and Studies
. Users can enroll in studies, but also might be eligible for studies.
Therefore, we are considering modelling this with two different tables: Enrollments
and Eligibilities
.
With schemas looking like:
Studies
:study_id
PK
User
user_id
PK
Enrollments
:enrollment_id
PKuser_id
FKstudy_id
FK
Eligibilities
eligibility_id
PKuser_id
FKstudy_id
FK
My question is: is this a good idea? I know that this would create two M2M relationships between two entities when it is advised to combine them into one. The issue when combining these relationships into one table is that these relationships are independent. For example, a user might be eligible for a study and not enroll, and a user might enroll in a study but not be eligible.