I have a project that we need to set up a simple branching strategy on to enable development of new features while still being able to fix bugs on another branch.
The problem I am having is with databases.
The database schema is part of TFS as a Database project, but to have enough testdata we did at one point take a backup of a live database and have used that for testing during development.
Currently the databases (tree in total) are located on a workgroup server with one set of databases for each developer, and each set of databases are updated once in a while with sql scripts the other developers create when they change the schema.
My question:
How can we reorganize this so that each branch is selfcontained and we can easily switch from one branch to another. I have already looked into using SQL express and placing the databases inside the branch, but this did not work out well. We have also looked into creating scripts with all the data and rebuild the database from the database, but this turned out to take too much time, and some developers tended to forget to do it often enough.
Any ideas?
Visual studio supports database projects. Use that and then hopefully branching will be relatively straightforward.
You can restore a database backup, and then use GDR to sync/upgrade your database schema. You would need to script data changes.
It does involve quite a bit of initial setup effort.
VSTS DB Team Blog
Visual Studio TFS Branching and Merging Guidance
Visual Studio Team Foundation Server Branching and Merging Guide