-
-
Notifications
You must be signed in to change notification settings - Fork 360
Can't use db:create with postgres #393
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
Comments
Duplicate of #338 The problem is, that db-migrate does try to connect to the database of your configuration, which will result in the error you have seen. database less connections are one of our work items though. |
Hey, thanks for the quick response! If I take the database and schema out of the configuration, should it work? |
Depends on the driver actually, either you need to define one that already exists or just no db at all. In case of pg we just pass the config to the pg driver below: In the case of pg this means it defaults to the username of the user executing db-migrate: Thus probably it might not help to remove this setting and I'm not sure if an empty string database setting would help. So probably we need to switch over to use https://github.com/brianc/node-postgres/wiki/Connection instead though. |
For anyone who runs into this, my workaround was to create a separate
I then run the create command like this:
|
Just a heads up that using the above approach can be automated using jq 'del(.mysql.database)' database.json > ./database-without-key.json &&\
db-migrate --config ./database-without-key.json -e mysql db:create alcomixer &&\
rm ./database-without-key.json |
Would love to see this fixed in core, following the docs in order and then trying to create a db leads to this error |
Just installed postgres with default settings. Created this config:
Then tried running
.
Got error:
Tried taking out "database" "identity" from config, and got:
Migrations seem to be working fine. I was able to manually create db, and run migrations. Just wondering what I'm doing wrong here.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: