Schema Compare allows you to select an SQL source control version either as a target or as a source as well as to create a new SQL source control version.
This topic describes the following features:
1. Under Source or Target select Source Control.
2. In the Repository box, click < Manage >.
3. In the Repository Manager window that appears, click the New button to add a new repository.
4. In the Source Control Repository Properties window, select a type of source control system and follow the instructions.
5. Click OK.
Alternatively, click + or … next to the Repository box.
1. Under Source or Target select Source Control.
2. In the drop-down list of the Repository box, select a repository.
3. In the Revision box, select a specified revision from the source control history or select the latest revision.
4. If you select a specified revision, the Revision history window opens. In the window, you can see the list of the source-control revisions of your database.
5. Select a required revision and view all code changes made in the commit, a commit message, and the type of operation that took place.
When source control version is a target, Schema Compare creates a synchronization script that can be saved to a file. Source control versions cannot be modified directly.
When a source control version is a source, a synchronization script can be executed directly against the target database.
Schema Compare doesn’t allow Working Folders comparison. Try using Scripts Folders instead.
1. Select Team Foundation Version Control (TFVC) from the Source Control system drop-down list box.
2. In Source Control settings, specify:
2.1. Server URL for the TFVC server.
2.2. Authentication type from the drop-down list.
Note
Azure DevOps Server refers to an on-premises server whereas Azure DevOps indicates a set of cloud-hosted DevOps services.
Note
The Base authentication type is not recommended due to its low security level.
Token is an OAuth authentication type. If you select this type, you will need to obtain an authorization token in the security settings of your server.
Windows is a windows-based authentication type used for an on-premises server. If you select this type, your current Windows user account will be used.
Web is an authentication type used for a cloud service. If you select this type, you will be prompted to enter a Username and Password for your web account.
Note
To get proper settings for Server URL, Username and Password, contact your system administrator.
2.3. Database folder in TFVC that contains SQL scripts for your project.
2.4. Repository name.
Click Test to check the connection.
3. Click OK to close the Source Control Repository Properties dialog box.
1. Select Subversion (SVN) from the Source Control system drop-down list box.
2. In Source control settings, specify:
Note
To get proper settings for Server URL, Username and Password, contact your system administrator.
Click Test to check the connection.
3. Click OK to close the Source Control Repository Properties dialog box.
1. Select SourceGear Vault from the Source Control system drop-down list box.
2. In Source control settings, specify:
Note
To get proper settings, contact your system administrator.
Click Test to check the connection.
3. Click OK to close the Source Control Repository Properties dialog box.
1. Select Perforce (P4) from the Source Control system drop-down list box.
2. In Source control settings, specify:
2.1. P4Port, Username and Password for the Perforce server.
2.2. Workspace. You can create a new workspace or select an existing one from the drop-down list box.
Note
It is important to ensure that the Source Control feature of dbForge Schema Compare uses its own workspace for each database link.
It is not recommended that you use this workspace from other applications.
To create a new workspace:
Note
dbForge Schema Compare will work with scripts from this folder only. If you leave the Folder field empty, it will be considered that the whole depot contains database scripts. In this case, database scripts will be located in one of the Devart folders.
To select an existing workspace:
Note
- Usage of existing workspace is not recommended due to possible conflicts with other applications or links.
- For the correct work of the Source Control feature of dbForge Schema Compare, you and your colleagues must use identical settings for P4Port, Depot and Folder when configuring a new Workspace.
- To get proper settings for P4Port, Username, Password, and Depot, contact your system administrator.
2.3. Repository name.
Click Test to check the connection.
3. Click OK to close the Source Control Repository Properties dialog box.
Note
Schema Compare supports Git for Windows client. Thanks to it you can work with all possible connection and authentication types as this task is delegated to the Git client. Before trying to connect your to a Git repository, make sure that you have Git for Windows client installed on your machine.
1. Select Git from the Source Control system drop-down list box and provide a path to your local Git repository that contains SQL scripts for your database project.
Note
To work with a remote repository, you need a clone of this repository. To retrieve a local clone, execute the git clone
command or use the GUI tool. After a successful creation of the clone, specify the path to the folder containing the clone in the Repository Folder field of the Repository Properties window. You can specify a path to a subfolder in the repository (not .git).
Click Test to check the connection.
Note
Keep in mind that you should work with the current repository branch. For this, it must have at least one commit.
2. Click OK to close the Source Control Repository Properties dialog box.
See also: How to create a GIT repository from scratch on GitHub.
1. Select Mercurial from the Source Control system drop-down list box.
2. In Source control settings, specify:
Note
To get proper settings, contact your system administrator.
Click Test to check the connection.
3. Click OK to close the Source Control Repository Properties dialog box.
If you want to configure the git-auto-commit action on every change in the structure of databases, refer to the How to Automatically Commit SQL Server Database Schema Changes to the GIT Repository article.
See also: Update to a revision from source control.