Thinking of the topic_links table?
https://github.com/discourse/discourse/blob/master/app/models/topic_link.rb