handle case where the entity table is in both databases