This is the fifth part of an extensive article dedicated to database versioning. Before you proceed with it, we suggest that you read the previous parts:
- Part I: Version Control with Git
- Part II: Database Versioning with Examples
- Parts III & IV: Database Version Control Using Source Control for SQL Server
In the final part, let’s review the Dedicated mode for repository connection. It implies that every developer works with their own local copy of the database.
By the way, if you are still not familiar with dbForge Source Control, feel free to watch this introductory video.
First, we unlink the JobEmplDB database from the source control repository.
Next, right-click the database, point to Source Control, and then click Unlink Database from Source Control:
A new window will appear asking to confirm the operation. Click OK:
We have unlinked the JobEmplDB database. Now, let’s link it again to the source control repository: right-click the JobEmplDB database, point to Source Control, and then click Link Database to Source Control in the context menu:
In the window that appears, configure the necessary parameters and select the Dedicated mode. Click Link:
Also, if you want to know how to collaborate on the same database project using Devart’s Source Control for SQL Server, feel free to watch this video.
Now, let’s change the Company table by adding the Source column. Use the following syntax:
ALTER TABLE [dbo].[Company]
ADD [Source] NVARCHAR(255);
To commit the changes, right-click the JobEmplDB database again, point to Source Control, and then click Commit:
In the window that appears, we can see all the changes already selected. We only need to add a comment and click Commit to send them to the repository:
When the commit process is over, we’ll get a new window informing us that the changes have been committed successfully. Click OK:
Now, let’s check that the Company table definition has been changed in the repository at GitHub:
More information on the development models is available at Shared vs Dedicated Development Models: Key Differences.
Conclusion
In this article, we reviewed the Dedicated mode for repository connection using dbForge Source Control. It can be integrated into SSMS to help the user version-control databases. Source Control is part of SQL Tools developed by Devart.