-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Accountable changes: Allow migration sets outside this repo #93
Comments
What is the usecase you're thinking of here for migrations? What is an example of a migration that you think partners would want to run? |
@kennsippell yes when I say "partners" I also wanted to say "us". I think that for the success of this feature is key to also implement #92 (transactions) , and also is key to change the way we write migrations script as I highlight in this comment in the same ticket:
The use case is to avoid errors that happened to us recently, and detect these errors before production in some cases, and because we cannot add into the medic-couch2pg codebase all the SQL scripts needed by each project, we need to allow a way of centralize these changes by medic-couch2pg . So we need:
The last point along with transactions is key, here is an example: An script drops a view "reports_aa". Instead of use the The only way to warranty this is:
Moreover, if all the changes are managed by medic-couch2pg, we can detect errors earlier in dev environments, because it's easier to reproduce the schema and the result of schema changes. |
We have in this project sets of migrations defined under the
libs/**/migrations/
folders, and each one only contains SQL scripts, there are no "business logic" behind the source code to perform complex migrations, just simple SQL scripts that after being executed Postgrator takes care of keep track of the migrations executed so they are executed in the right order.If we allow partners to create outside this projects a repo with the migrations they want to run, the changes will be accountable, and handled by the same tool: medic-couch2pg.
If this change sounds reasonable, I can create a draft with the structure and the usage changes needed.
CC @garethbowen @kennsippell
The text was updated successfully, but these errors were encountered: