-
Notifications
You must be signed in to change notification settings - Fork 36
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
If sails is already loaded, do not load again #66
base: master
Are you sure you want to change the base?
Conversation
Conflicts: lib/sails-migrations/helpers/sails_integration.js
@kmcgrath Are you sure that the |
@mikermcneil Maybe you can advise me on this one :) It looks good to me, but you probably know better. |
@RWOverdijk |
@kmcgrath Almost! I just wonder if migrations perhaps needs some settings that the running instance perhaps doesn't have |
@kmcgrath Is this PR still relevant to you? |
It is. We use this to provide an admin interface that can be used to see migration status as well as bootstrap new applications through a web interface/API. |
To me this PR makes sense. I haven't tested it yet, so I should. Have you tested this with and without running it yourself? If so, could you perhaps tell me how you tested it? This lib needs more tests, I'm aware of that. |
We have a DevOps team running it in production for an internal application. I'm actually not on that project anymore but I help out when needed. I can try to get one of them on this PR, if needed. |
@kmcgrath Seeing how this is a tool used in production by multiple people, I'd very much like that yes. Better safe than sorry. :) |
@kmcgrath Would you mind rebasing this? I just merged the other PR, which conflicts with this one. |
… into feature/look-for-sails Conflicts: lib/sails-migrations/helpers/sails_integration.js
Conflicts: lib/sails-migrations/helpers/sails_integration.js
Sorry for the multiple commits we had a branch with two already merged. I resolved then merged with that one. It boils down to one condition statement that checks for |
This allows sails-migrations to be used within sails itself. It checks to see if sails is already loaded. If so, it does not do it again.
Then it is possible use sails-migrations directly to report on status and currentVersion from a Controller.
In the following example I also have the ability to migrate and roll back, but I realize you may not want to do that here, unless bootstrapping an application through a web interface.