Description
I don't think the environment should default to dev because you can accidently populate your dev db if you forget to specify the env paramater.
An example use case is we have 3 servers - dev, int, and prod, which have those same NODE_ENV's set (so the NODE_ENV=dev on the dev server etc.).
All the developers also have their own local mongo instances installed as well. If I just run $ db-migrate up
on my local machine, it's running those migrations against the dev server even though I just want them to run locally.
I'm advocating that the default environment should be "undefined" because that is what the NODE_ENV is by default.
Then in my database.json
file i would just have a block for the "undefined" environment which is actually my local environment.
{
"undefined": {
"driver": "mongodb",
"host": "localhost",
"database": "my_db"
},
}
Thoughts?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.