dbForge Source Control helps to update your version control repository by committing changes made in a database. You can manage the changes in Source Control Manager.
To start working with Source Control Manager, first, you need to link a database to the version control repository. To do that, follow the steps in the how-to topics depending on the source control or version control systems you use:
The linked database gets the following icon in Object Explorer:
After the database has been linked to the remote repository, dbForge Source Control checks whether any changes were made to the database locally or remotely and committed to the repository. In addition, the tool checks if there are any conflicts meaning that several developers were making changes to the same file both in the repository and in the database.
The Refresh progress window opens automatically, showing the stages of the refresh operation.
After the refresh operation is complete, Source Control Manager opens displaying all the changes in the following sections:
It should be noted that Source Control Manager can display either all three sections or two of them or just one section.
If the database and version control repository are identical and no changes are found, the following window is displayed:
In the Local changes section, select the checkboxes next to the objects and/or static data that you want to commit, enter the comment describing your commit, and then click Commit. When you view the history of changes, the comments you’ve added to the commit will allow you to identify why the changes have been committed.
If you select the checkbox next to Local changes, all changes will be selected.
The Comment text box is not available when a database is linked to a working folder.
As you can see in the screenshot above, the Source Control grid contains the following columns:
|Change Type||For Commit:
Actions to be applied to the object or static data in the source control repository; these include Add (the object or data will be added); Modify (the object or data will be modified); Remove (the object or data will be removed).
Actions to be applied to the object (but not to static data) in the linked database; these include the following action for database objects: Add (the object will be dropped); Modify (the object will be altered); Remove (the object will be created). For more information about how to undo changes, see Undoing changes.
|Type||The type of the object|
|Name||The name of the object that will undergo changes; a <name> (Data) construction refers to static data|
|Owner||The schema or database in which the object was created|
If you select not all objects in the Local Changes section but only one that depends on other objects or changes, then after clicking Commit, you will see the following window with the suggestion to include all affected objects:
This case may occur when you add two new database objects such as a table and a view which select data from this new table. So, when you choose to commit only the new view, you will be suggested to commit the table associated with this view. In addition, you can exclude any related object from the commit.
After clicking Commit, the Commit progress window opens, showing the stages of the commit operation. When all the stages are complete, click OK to close the window.
So, local changes made in the database have successfully been committed to the version control repository with the help of dbForge Source Control.
See also: How to roll back a commit in Git.