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

Add mongodb persistence #80

Closed
wants to merge 2 commits into from
Closed

Add mongodb persistence #80

wants to merge 2 commits into from

Conversation

ikatun
Copy link

@ikatun ikatun commented Sep 22, 2017

Added --state-db option which contains the name of env variable where DB connection string is stored.

For example --state-db MONGO_DB_CONNECTION_STRING means that connection string for DB is stored in process.env.MONGO_DB_CONNECTION_STRING.

Added a wildcard dependancy for promised-mongo because any version of promised-mongo contains the functionality required for this PR.

Connection string is deliberately not read from the argument directly because usually server environments pass connection string as an env var.

@wesleytodd
Copy link
Collaborator

Hey @ikatun! Thanks for the PR, but I do not think we will be moving in the direction of direct support for certain persistence layers.

If you take a look at the work being done on the upcoming 1.x release [1], you can see that "storage engines" is already implemented. All you need to do is provide a compatible "store" [2]. If you want, you can install the fork I was running and get a "work in progress" version of these changes [3].

[1] #77
[2] https://github.com/tj/node-migrate/blob/1.x/lib/file-store.js
[3] https://www.npmjs.com/package/@wesleytodd/migrate

@wesleytodd wesleytodd closed this Sep 22, 2017
@ikatun
Copy link
Author

ikatun commented Oct 6, 2017

You could reference the fork of your library (https://www.npmjs.com/package/migrate-mongodb) for all of those poor developers who want to use your library and store the statefile to the mongo database (while we're waiting for that new storage engine/mongodb refactor thingy) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants