I'm afraid I don't understand what you mean by add_reference.  I assume it has to do with hint_id being a foreign key but don't know where to go from there.