Skip to content
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

Create command requires valid connection to MongoDB #32

Closed
etki opened this issue Feb 22, 2018 · 1 comment
Closed

Create command requires valid connection to MongoDB #32

etki opened this issue Feb 22, 2018 · 1 comment
Labels

Comments

@etki
Copy link

etki commented Feb 22, 2018

I can't create a migration without connecting to MongoDB, which is obviously unnecessary.

@balmasi
Copy link
Owner

balmasi commented Jul 7, 2019

Upon closer inspection, I remembered this is by design.

This migrator looks at the db to ensure that:

  1. there are no migrations in the db (that could potentially be missing from the file system for some reason) with the same name
  2. If there are migrations in the file system that don't exist in the database, auto-import them to the db.
  3. as soon as the migration is created, upload the fact that it exists (and is in a down state) to the database so you don't have to rely on devs doing that in a separate step

In essence, this is just for better user experience.

It's much better to have a safe and informative default setting (sync DB on any command and notify the user if anything is wrong or unexpected).

The connection to the database is brief and lightweight.

I'm closing this but am open to further discussion if you feel it's causing a problem

@balmasi balmasi closed this as completed Jul 7, 2019
@balmasi balmasi added the wontfix label Jul 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants