Fix foreign key type for has-many associations, retrofits fixe@71068a1