handle provider IDs correctly when merging databases