-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Can't run CLI without mysql client #18
Comments
I'm hitting this too and can't (read, don't want to) install mysql. There used to be an option for |
will try to fix that during the next week! PRs are welcome though |
I fixed it locally by doing this: var helpers = require(__dirname)
, _ = require('lodash')
, _s = require('underscore.string')
, Sequelize = require('sequelize')
, config = helpers.config.readConfig()
var sequelize = new Sequelize(
config.database,
config.username,
config.password,
config
) However, I don't think that will work with connection URLs? |
You should be able to pass a connection URL to the constructor ( |
Yeah, but I don't want to have to figure out which variant came from the config. I happen to be using a .js file that returns a JSON object, but AFAIK other users may be using connection URLs. I'm just reading config-helper.js now to understand it better. That code is at the top of migration-helper.js, where the bug is, BTW. |
Ah no, that code should actually fix this. The config-helper parses the URL and canonicalizes to JSON. I'll send a PR. |
I think it does seem like a clumsy way of converting names though, but it's pragmatic for now in any case. |
Raised #21. Would be nice to get a release out when it's possible. Or is there some way I can use my fork in the interim, without |
You can point your package.json at GH: {
"sequelize": "sequelize/sequelize#commit-ish"
} |
their is a fair chance that this issue is fixed with #22. |
i just released v0.2.4. can you give that a try? |
Tested, works. Thanks heaps! 👯 |
great! |
Don't wanna be a party pooper but this just happened for me. |
I should mention I'm trying to use postgres, and the relevant part of my config.json is
|
Haha, never mind, this is actually just a horribly unclear error message because the sequelize-cli code defaults to mysql instead of telling you what actually went wrong, to wit, it couldn't find an option. |
If I attempt to use the CLI without the mysql client dependency, it fails:
The problem seems to be that migration-helper.js instantiates a Sequelize instance which is uses the mysql dialect as a default. It look it's just using the instance to map model names to table names.
Workaround: Adding
"mysql": "^2.3.2",
to my project package.json allows the CLI to run properly.The text was updated successfully, but these errors were encountered: