-
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
New feature: support sql files #189
Comments
I think this tool is great as a standalone thing that focuses on its core utilities: executing files up/down exports in the correct order. I am needing this to manage changes for our dev environments as features are added and removed. We will also be using this to manage mongodb, cosmos, and elasticsearch migrations. No need to bloat the core utility with language/database specific stuff. I suggest creating your own |
@DesignByOnyx's comment is exactly what differentiates this tool from the many others out there, you can write technology agnostic migrations, which is often a need in projects. I agree with the design as well of importing this as a library. I actually started a version of this tool which was more oriented to exposing the core components as libs but never ended up having the time to finish it. That said, even though this is not as easy as it could be, the current version of this lib works well enough in that form that it should be pretty simple to wrap (and I have also done that in past projects). EDIT: this is funny, I think I actually meant to publish that wrapper as OSS, I created the repo but apparently never pushed the code. https://github.com/wesleytodd/migrate-pg |
Because 90% of all use cases involve SQL, or at least that's my suspicion, when using a migration tool like this package provides. That's why I think it might be good addition to include an utility function what adds support for doing something based on a list of (SQL) files their content.
Currently I'm using a function in one of my projects just like that and I thought why not share it?
...
All what is needed is a file structure like this (note as of v1.7.0, you can't have this structure in the same directory as where your migrations are stored, it should be on a higher level):
Then the next thing to do is to setup a single migration:
The functions
upFromFiles
anddownFromFiles
could be defined as following:Maybe if the package author agrees this code can be integrated with this package. If not and people do prefer to have this around for the taking. Then I might consider to publish into a separate package.
The text was updated successfully, but these errors were encountered: