-
Notifications
You must be signed in to change notification settings - Fork 73
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
Support multiple PKs during backfilling #426
Support multiple PKs during backfilling #426
Conversation
…tiple-primary-keys-when-backfilling
…tiple-primary-keys-when-backfilling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good; just a couple of small things.
pkg/migrations/backfill.go
Outdated
pq.QuoteIdentifier(b.table.Name), | ||
b.batchSize, | ||
whereClause) | ||
return fmt.Sprintf("SELECT %[1]s FROM %[2]s %[3]sORDER BY %[1]s LIMIT %[4]d FOR NO KEY UPDATE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Sprintf("SELECT %[1]s FROM %[2]s %[3]sORDER BY %[1]s LIMIT %[4]d FOR NO KEY UPDATE", | |
return fmt.Sprintf("SELECT %[1]s FROM %[2]s %[3]s ORDER BY %[1]s LIMIT %[4]d FOR NO KEY UPDATE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record this change adds an extra whitespace when where
cluase is missing.
…tiple-primary-keys-when-backfilling
This PR adds support for using multiple primary keys during the backfilling
part of the migration.
In this PR I extracted the statement builder into a separate struct to
make it easier to check for the expected statements.