4 ms·
A lot of replies talks about schema migration and tools like Liquibase etc. But as I understand the question, it's about running update / delete queries in prod
by aggrrrh 5y ago
A lot of replies talks about schema migration and tools like Liquibase etc. But as I understand the question, it's about running update / delete queries in production environment, not DDL.
In my opinion such queries should be subject of established development process:
1. Commit your query to a repository
2. Send to code review
3. After successful review and merge it should be deployed automatically by ci/cd
It may be necessary to run query directly via console in some cases, though. But such query should be committed to the repository latter any way.
And of course you should use proper tools like comments suggest.
- sverhagen 5y agoFlyway and Liquibase do update and delete queries fine too, albeit that's not their main intended use case.
- slindsey 5y agoCorrect. We use Flyway and have it setup through GitLab CI/CD pipelines. We used to have a bottleneck on one of two people with permissions. Now, if data needs to be pushed to the production system for some reason through a script, an Issue/MR in GitLab gets the Flyway script, it must be approved by two people on the team (other than the person who did the work), it must make it through the test system, and then can be pushed to production directly through GitLab. It increases the process but is safer and reduces the bus factor.
- throwaway984393 5y agoThis is the way.