Database version management and figuring out which scripts need to be run when deploying the latest version of your web app
When you are maintaining multiple web apps across environments it can be difficult to keep track of which scripts need to be run to upgrade the database when it comes time to deploy. If you’re maintaining different versions of web apps across environments when the versions can sometimes be significantly out of sync, the difficulty of determining which update scripts need to be run on deployment can explode.
While there are a ton of approaches to keeping your database under version control, if you want something simple and effective that you can implement with minimal time and effort, consider a DatabaseVersionHistory table in your database.
A database version history table will allow you to see at a glance the state the database is in and by comparing it with the update scripts in source control, you will quickly be able to determine which update scripts need to be run.
This post is intended as a living document that will evolve and grow over time. If there’s something you think I missed or would like something clarified, please feel free to leave a comment.
Who should be reading this FAQ?
Managers, developers, testers, anybody working or contributing on a software project.
When should a small team be using an issue tracker such as JIRA?
A young startup may initially get away just fine by working informally and by email, and early in the project you’ll want to have as little administrative burden as possible, however as a project and team matures, there will come a time when having a searchable, persistent audit history of business decisions, fixes (and why they were done) and completed tasks will become invaluable.
This audit history goes hand-in-hand with a good version control commit history.
After installing Visual Studio 2012, I found that the open file dialog wasn’t being displayed. I could open projects via Windows explorer, via the recent projects menu, compile, run etc, however neither Open Project or the File->Open->Project/Solution were working.
What was strange about this is that other dialogs such as New Project were working fine.
After much searching and testing, enabling the Tablet PC Input Service fixed the issue. This does not make much sense since I’m not using a tablet pc, however it works for me and may work for you.
To enable the service:
Why would I want to use Mercurial or any other DVCS client with a Subversion repository?
- It lets us keep SVN as our central repository
- Some team members prefer not to use a DVCS for whatever reason so it lets them carry on using SVN without interruption.
- It allows me to work and commit changes (but not push!), search history and switch between branches completely disconnected. I can continue to work during network outages or while traveling when I don’t have connectivity.
- You get full, fast history search.
- Switching between branches is easy and fast.
- Any automated processes which use SVN (i.e. automated builds and deployments) can continue to operate while everyone moves to DVCS.
- It’s much easier to perform merges than regular SVN (via export/import patch queues – which I detail later)
If you are connecting to a SQL server with the SQL profiler and none of your templates are showing up, compare the versions of the SQL profiler you are running and the version of SQL server that you’re connecting to; there is likely a version mismatch.
If this is the case, what’s likely happening here is that you’re connecting to a SQL 10.50 instance with a SQL 10.0 profiler and the profile templates for 10.50 aren’t present.
This works just fine, however you can let the browser select the protocol depending on the request by the following snippet: