-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Postgres - add x-migrations-table-quoted url query option (#95) #533
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
Postgres - add x-migrations-table-quoted url query option (#95) #533
Conversation
|
@dhui what do you think about this implementation? |
|
I’m probably just confused, but in ensureVersionTable(), line 454, why does it not respect the config setting for the schema when it’s verifying whether or not the table exists already? query := `SELECT COUNT(1) FROM information_schema.tables WHERE table_name = $1 AND table_schema = (SELECT current_schema()) LIMIT 1` |
Ok, it is a new code: spacefill@511ae9f I'm going to fix this part 👍 |
ac69c0f to
525c478
Compare
@FAQinghere @dhui implemented in my last push. I think that the next task is to implement the same feature for |
525c478 to
f98a02e
Compare
|
I don't understand this The code is here type Config struct {
MigrationsTable string
MigrationsTableQuoted bool
DatabaseName string
SchemaName string
StatementTimeout time.Duration
MultiStatementEnabled bool
MultiStatementMaxSize int
}I don't understand where is my error🤔 |
|
Words are 4 or 8 bytes long (32-bit vs 64-bit systems), and fields in structs are probably word-aligned. If a bool only needs one byte, and is followed by something else that doesn’t fit within the same word, then the rest of the word will be padded out (skipped), bloating the struct. Maybe move the bools to the end. |
f98a02e to
6890aa5
Compare
Pull Request Test Coverage Report for Build 292
💛 - Coveralls |
cf2fbf4 to
f31e3b5
Compare
@dhui I think that you can review. |
dhui
left a comment
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.
Thanks for the PR!
Thanks for updating both the postgres and pgx drivers! Don't forget to apply any changes to both the pgx and postgres drivers.
f31e3b5 to
4ff1792
Compare
|
@dhui all you feedbacks had been applied. New need review 😉 |
4ff1792 to
d695432
Compare
dhui
left a comment
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.
Thanks for addressing the PR feedback!
d695432 to
63ed3da
Compare
…postgres and pgx drivers (golang-migrate#95) By default, gomigrate quote migrations table name, if `x-migrations-table-quoted` is enabled, then you must to quote migrations table name manually, for instance `"gomigrate"."schema_migrations"`
63ed3da to
fcf19a1
Compare
|
New need review 😉 (see this comment) |
dhui
left a comment
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.
Thanks for addressing the PR feedback!
For future changes, can you push your changes as a new commit on top of the latest PR commit? If you need to force push to re-run tests, just amend the latest commit. This makes it easier for me to review so I don't need to review the whole PR again. If there are a lot of commits, I'll squash-merge the PR.
dhui
left a comment
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.
Thanks for going through the multiple rounds of feedback!
|
@dhui thanks 🙂 nitpick: last commit message |
|
With Github's squash-merge, the commit messages are combined into the squashed commit's message. |
Yes I know, but it was a "work in progress" commit message. That why I like to |
Following this comment, this is a new Pull Request.
By default, gomigrate quote migrations table name, if
x-migrations-table-quotedis enabled, then you must to quote migrations table name manually, for instance"gomigrate"."schema_migrations".I have used this playground to test this branch.