Unique constraint on M2M Through

Would this help?