-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Allow for multistatement migrations in Neo4j #328
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
Conversation
Pull Request Test Coverage Report for Build 654
💛 - Coveralls |
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.
Migrations in migrate
are treated as opaque blobs: https://github.com/golang-migrate/migrate/blob/master/MIGRATIONS.md#migration-content-format
To support multiple statements in a migration, add a x-multi-statement
option and document accordingly. See the cassandra and clickhouse drivers as an example.
9b8889f
to
ae1cc1a
Compare
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 feedback! Just a couple more things.
database/neo4j/neo4j.go
Outdated
URL: uri.String(), | ||
AuthToken: authToken, | ||
MigrationsLabel: DefaultMigrationsLabel, | ||
MultiStatement: multi == "true", |
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.
Use strconv.ParseBool()
and handle the error properly
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.
Done
database/neo4j/neo4j.go
Outdated
if _, err := neo4j.Collect(session.Run(string(body[:]), nil)); err != nil { | ||
return err | ||
if n.config.MultiStatement { | ||
statements := bytes.Split(body, []byte{';'}) |
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.
Might as well make the separate an internal package level variable/constant
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.
Pulled into a constant
No description provided.