Skill 2.3.4

Configure source control for SQL Database Projects

Key Concepts

The project folder, with one file per object organized by schema and object type, is committed to a Git repository, usually next to the application code it supports. Build output (bin/ and obj/) and user-specific files are excluded with .gitignore, and publish profiles may be committed only if they contain no secrets. VS Code and Visual Studio provide Git integration, and SQL database in Fabric can connect a workspace to Git so that database objects are synchronized as a SQL project.

An existing database is brought under source control by importing it into a new project (for example from the SQL Database Projects extension or with SqlPackage Extract), committing that baseline, and then making all further changes in the project rather than directly in databases. Commit messages and pull requests explain each schema change.