-
Notifications
You must be signed in to change notification settings - Fork 225
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
Added mongodb as custom state storage #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @krishna-atkalikar, thanks for the new example! I think it is a great idea to have a mongo example, I just have a few comments on the specific implementation details.
} | ||
} | ||
|
||
module.exports = MongoDbStore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with the pg
example, this should not be exported but used to run migrations. See: https://github.com/tj/node-migrate/blob/master/examples/custom-state-storage/custom-state-storage.js#L51-L66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I use migrate.load() and pass custom state store it still fails with TypeError: Store is not a constructor
but it works fine with module.exports = MongoDbStore;
.
Thanks for making those updates. I didn't notice this before, but can you make it follow the style enforced by the linter? Once it follows that, I will probably let it sit here for a bit to see if anyone with more mongo experience has opinions. |
FYI: We've built something similar. It's available here and via NPM https://github.com/NodePit/node-migrate-state-store-mongodb Feedback and contributions welcome. |
No description provided.