We have such structure that almost all entities has PK (master_user_id, id) with FK (ref_master_user_id, ref_id; origin_master_user_id, origin_id).
PK (master_user_id, id)
FK (ref_master_user_id, ref_id; origin_master_user_id, origin_id)