Add belongsto and hasmany for schedule, schedulepreference, and userstate