by dillonmckay · 7y ago · 0 comments
We have a tool to generate the XML and to take the XML and compare with a database and altering it to match the XML schema. Though we never delete data due to backwards compatibility, so no dropping of objects, reduction of column widths etc.
When deploying a new version the database is processed first, if successful the new executable is made available. If not it calls home so we can take a look.
To make changes in development, we commit a new XML to dev branch, we have a commit hook to upgrade the dev database.
All stored procedures, table definitions, etc were checked in. There was a whole release process and QA to bundle the right versions of things into deployables which I did. It didn’t work flawlessly but it worked and when it failed it was straightforward enough that figure out why was easy.
The tools in Visual Studio will also help you create migration scripts and do schema/data diffs.
Sql and stored procedures are just a textual source code. You can put it into version control, do code reviews, or build CICD pipelines for sql and stored procedures just like for any other language...
The only challenge is the deployment environment, as databases offer a stateful runtime engine, so you'll want to consider it's state. But state can also be managed in CICD pipelines, with scripting, sql-loader, backups, or similar.