safety check to ensure ids inserted into relations table are of the correct type
(could reduce number of sql hits)