I have a data model that i have some concerns over. Here it is:

My concern is that it’s possible to assign an application to a member, and then assign a role that is from a different application to the member.
Now, I know I can put a constraint on this to ensure that doesn’t happen, but that seems like a bandaid. I would rather design the model so that a constraint was not required.
Can anyone suggest how to alter the model to ensure that a member can only be assigned roles from an application it is assigned to?
Usually, you run into this kind of problem when you’ve split a key. Fixing that split key, then using overlapping foreign key constraints is usually what you’re looking for.
Member 1 is assigned only to application 1. So trying to insert a row that references application 2 should fail.