Saturday, November 23, 2024
HomeProductsSQL Server ToolsDedicated Link Source Control Repository

Dedicated Link Source Control Repository

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.

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:

Unlink the database from Source Control
Picture 1. 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 2. 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 3. 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 4. Configure the database linking to the source control repository

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:

View changes for commit
Picture 5. 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 6. 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 7. Changes committed successfully

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

Picture 8. 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.

RELATED ARTICLES

Whitepaper

Social

Topics

Products