r/SQLServer•
HalMaxi

Suggestions for CI/CD of SQL database using TFS

Our team is looking to get better at Continuous Integration and Continuous Deployment. We've got a decent grasp on how to do this for our windows applications and webapps, but the database behind all of these is a different story. We have a legacy database which is now in source control using TFS. It is easy enough to build the database from source control to a dakpac, but managing the deployment for testing and to production is causing a headache. How do others handle this? Right now, we create a diff script between the dakpacs of every build and must apply each script in sequence to each environment.

Some specific challenges:
we currently have two distinct production environments which do not match, cannot be made to match, and can never be combined
the database requires meta data in order for the applications to work, and the meta data is specific to the environment that it is in
any testing of the database would require some amount of sample data, but the structure of the database makes creating or copying this exceptionally difficult. any script to do this would be outdated in short time.
we depend on triggers and jobs on the server to maintain the data (some of the business logic is embedded in sql run by jobs, i know this is ugly but it is what we have) the users vary by environment

Posted Nov 21, 2016, 9:49 PM UTC

33
Loading comments…