Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated columns #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

yoki123
Copy link

@yoki123 yoki123 commented Jan 1, 2020

Add a random number for the column's name while column's name is duplicated

columns[i] = postgresify(col)
name := postgresify(col)
if inArray(columns[0:i], name) {
name += fmt.Sprintf("_%d", rand.Intn(10000))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name += fmt.Sprintf("_%d", rand.Intn(10000))
name += fmt.Sprintf("_%d", i)

@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io"
"math/rand"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"math/rand"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants