How to best use Git For SQL Scripts?
JohnHansonACBHCS
Posts: 2 New member
Our Team has a number of SQL Developers, and we would like to use Git efficiently to Check in / out our SQL Scripts.
the Table Schema seems to be handled by SQL Source Control but not Scripts. our preferred flow would be to either Check out a script or create a new one, and then Check it in. on Check in, another team member could see the script and the author / last editor. Look forward to seeing your ideas.
the Table Schema seems to be handled by SQL Source Control but not Scripts. our preferred flow would be to either Check out a script or create a new one, and then Check it in. on Check in, another team member could see the script and the author / last editor. Look forward to seeing your ideas.
Tagged:
Answers
Hi @JohnHansonACBHCS
Thank you for reaching out on the Redgate forums.
It may not be possible to achieve this using SQL Source Control. As you mention, it is used to version control your schemas and not scripts.
I would suggest Flyway as your potential solution to this scenario to handle database scripts migrations between developers using Git as your chosen Version Control System.
I have some potentially helpful links outlining how Flyway can connect with your version control repo of choice and help with the push/pull of scripts between developers
https://documentation.red-gate.com/fd/version-control-138347113.html
https://www.red-gate.com/hub/product-learning/flyway/a-simple-example-of-flyway-development-using-github-branching
If wanting to trial Flyway, it can be accessed through the following link:
https://www.red-gate.com/products/flyway/
Our free Community offering of Flyway may be suitable for your requirements and give you the ability to set up a project, test the process to connect your database scripts with Flyway & handle database changes with your team easier.
Hope this is of help for your requirements.