Back in my post about structuring your source code, I recommended to have a “DB” folder where you can keep your database. This is actually one of my favorite topics of configuration management, and the reason for this is that I realized how many companies and projects don’t keep their database under version control.
DB folder contentThe folders that will rest inside the “DB” depend on each of the different database versioning schemes. Nevertheless, I would recommend having a “common scripts” folder where you can store common tasks you usually perform in your database. Examples of the scripts I usually store there are: clean up scripts, testing users, and testing data/configuration.
Database versioning schemesI have come across with three different ways of versioning a database:
- Store a backup of the database each time you modify something.
- Store “incremental changes” scripts.
- Use the Database project type shipped with Visual Studio Team Edition.