In this post I’ll show you how easy it is to use Deployment Manager to deploy database changes from your source control system.
In a recent post Justin reminded us how important it is to source control everything. In fact it was his number one tip for Achieving Continuous Delivery. Like it or not “everything” includes the database. Source controlling databases used to be hard, but luckily it’s no longer a problem thanks to Red Gate’s SQL Source Control tool.
Over the past few of years, we’ve been loud proponents that like application releases, database releases should be based on source control. Simply comparing your development and production environments and syncing with SQL Compare isn’t enough. I won’t delve into the intricate details of why this is isn’t best practice here, but Justin is planning an article on this topic (so make sure to subscribe to our RSS feed to catch this).
Deploying from source control is not a problem if you are doing continuous integration (CI) as your packages are already based on source control, but what if you aren’t? Pretty much everyone wants to use CI, but not all of us are yet in a situation where it is possible. If you aren’t yet using a CI server you can use the Deployment Manager SSMS add-in to create database packages and publish them to Deployment Manager. However, until now this approach only allowed you to create a package based on the current state of a database, not your source code.
This wasn’t good enough for us. So we integrated SQL Source Control into the Deployment Manager SSMS add-in. You now have the option to create a package based on any historical version of your database.
How to deploy database changes from source control with Deployment Manager:
- Launch the Deployment Manager SSMS add-in by right clicking on your database in the object explorer
- Select SQL Source Control as the database source on the second page
- You’ll then be asked which revision you’d like to use to create a package
- Once you’ve published your database package to Deployment Manager you can then create a release and deploy it to your chosen environment
You’ll find more detailed instructions on our documentation site.