#259 Fixes issue where constraint references table of different database