db-migrate / db-migrate/node-db-migrate

Default environment should not be dev

Open
#219 23 comments 0 reactions 0 assignees View on GitHub
Refactoring
Dominant language
JavaScript
Stars
2.3k
Forks
361
PR merge metrics
No merged PRs in 30d

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.

``` json
{
"undefined": {
"driver": "mongodb",
"host": "localhost",
"database": "my_db"
},
}
```

Thoughts?
##

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8498303-default-environment-should-not-be-dev?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.