-
Notifications
You must be signed in to change notification settings - Fork 283
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
Panic when using dialect: mysql #2
Comments
Oh damn, I hadn't tested with MySQL. Looks like we'll need to figure out a way to pass dialect options. The good news is that we can fix this internally. Only time the gorp dialect is used is when the migrations table is updated. I'll push a fix. |
I've pushed a possible fix. Try updating sql-migrate (the go get -u github.com/rubenv/sql-migrate/... I've reopened the issue to make sure we don't lose track of it. Let me know if it works. |
Awesome, thanks.
The gorp_migrations table looks fine:
Edit: In fact, Edit 2: Looking at the MySQL driver documentation, this can be fixed by adding |
I'm not sure that we can, since the sql.DB is supplied externally (we can off-course do it in the command-line tool). Seems like this is only needed when you use Go-MySQL-Driver, the other one (mymysql) does parse dates correctly. Is there a way to detect that a) it's a Go-MySQL-Driver connection and b) it doesn't have the required setting? |
I don't think it's possible to add the parameter to existing connections anyways, so it's probably best to just document this somewhere. The command-line tool would have to parse the connection string and append either |
We can probably add a check for this: if the dialect is mysql, do a simple |
I'll have a look at adding scripted tests for the tool as well, these can do full integration tests with the database, that should prevent future failures. |
There's a warning now, which will inform you to add the Also check the |
With
dialect: mysql
I get the following when runningsql-migrate up
:Looking at the source, the engine and encoding need to be set somehow. Am I missing some option?
The text was updated successfully, but these errors were encountered: