Never has an MDF file in the source tree. MDF is the result of deploying the application, not part of the application sources. Thinking in a database from the point of view of the development source is a short cut to the line.
All development results should be scripts that deploy or update the database. Any change, no matter how small, takes the form of a script. Some recommend using comparison tools, but I think this is a hole for rats. I support the database metadata version and have scripts for upgrading from version N to version N + 1. When deployed, the application can check the current deployed version, and then run all the upgrade scripts that bring the version to the current one. There is no script to deploy the current version directly, the new deployment deploys the v0 database first, and then goes through all version updates, including deleting an object that is no longer in use. Although this may seem a bit extreme, that is how SQL Server itself tracks various changes that occur in the database between releases.
As simple text scripts, all database update scripts are stored in version control in the same way as any other sources, with change tracking, differences and checks.
For more discussion and some examples, see "Versioning" and your database .
source share