Dedicated Link Source Control Repository

May 6th, 2021

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:

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.

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:

Unlink the database from Source Control
Picture 56. Unlinking the database from the source control repository

A new window will appear asking to confirm the operation. Click OK:

Confirm unlinking the database
Picture 57. Confirm unlinking the database from the source control repository

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:

Link the database to Source Control
Picture 58. Linking the database to the source control repository

In the window that appears, configure the necessary parameters and select the Dedicated mode. Click Link:

Configure the database linking
Picture 59. Configure the database linking to the source control repository

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:

View changes for commit
Picture 60. Viewing changes for 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:

See the changes selected for commit
Picture 61. Selected changes for commit

When the commit process is over, we’ll get a new window informing us that the changes have been committed successfully. Click OK:

Changes committed successfully
Picture 62. Changes committed successfully

Now, let’s check that the Company table definition has been changed in the repository at GitHub:

The Company table definition has been changed in the GitHub repository
Picture 63. The Company table definition in the GitHub repository

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.

Evgeniy Gribkov

Comments are closed.