Add database merging script