This article will explain the user default configuration when the database source control is done with ApexSQL Source Control.
In this article, default options from this database source control tool will be explained. The default options are predefined options that are used for work with a database in the database source control.
The user default configuration/options will be explained through the linking process (the Source control setup window) and Options window from the ApexSQL menu in SQL Server Management Studio.
The Source control setup window
In order to link a database to the database source control, in the Object Explorer panel right-click on the selected database and click the Linking a database to source control option:
This action will open the Source control setup window. In the Connection type tab, the Native radio button is primarily selected, with the Git source control system first presented from the Source control system drop-down list next to the four more natively supported source control systems to chose:
Under the Development model tab, the second tab in the Source control setup window, by default will be selected the Dedicated development model for database source control:
If the Shared development model is chosen, by default, the database source control tool will create the framework objects database (ApexSQL database), which will be used for storing all needed framework objects. For framework objects database can be chosen any other database from the same SQL Server where the specified database for linking is stored. That database can be chosen from the Database drop-down list:
The Object filtering tab, the next tab in the Source control setup window, is used for filtering database objects, to include or exclude them from database source control, for tracking changes on them or not. All objects for the linked database are checked by default. More information about this feature can be found in Object filtering article:
In the Script options tab, the user has the opportunity to choose comparison options that are applied only to the compare process in the Action center tab between the linked database and the source control repository. By default, some of the Ignore comparison options are already checked, which means the specified attributes will be ignored as differences when database and repository states are compared in the Action center tab:
Under this tab, the synchronization script options can be set as well.
The Synchronization options affect the way the synchronization script between the database and source control repository is created for deployment changes from the source control repository to the linked database. By default, the Include dependent database objects option is checked, and the synchronization script will include all dependent objects to the object that is chosen for deployment to the linked database:
The more information about topics from the above would be found in the Script comparison and synchronization options in ApexSQL Source Control article.
To open the Options window go to ApexSQL menu in SQL Server Management Studio, and from the ApexSQL Source Control sub-menu click the Options command:
Under the first tab, the General tab, are listed all general options for database source control regardless of the chosen source control system and development model. The most important options under this tab are:
- Object status check interval – the period in which the database object status will be checked
- Show warning for changing policies in the Administration tab – if this option is set to Yes, the warning message about policy change in the shared development model will be raised whenever the Administration tab is clicked
- Working copy of repository – this option will define the path of the working copy of the repository for all linked databases from the specified SQL Server
To change the list of the excluded objects defined under the Object filtering tab in the Source control setup window can be done under the Object filtering tab in the Options window. The one difference will be specifying the SQL server and database before the excluded objects list change can be done.
In the Options window, the Objects filtering tab contains two tabs:
- Local settings tab – is the same as the Object filtering tab from the Source control setup window, and those settings are bound to a user on the local machine. Those settings won’t affect users that working on a separate machine no matter which development model is used
- Global settings tab – is similar to the Local setting tab; the only difference is that the Global settings tab is used for the database linked in the shared development model. Any change made under the Global settings tab will affect all users working on the specified shared database
More information and answers for this topic will be offered by the Object filtering article.
Under the Action center tab, in the Options window, the Require comments and Show comment block options are checked by default. Those options are useful in environments where several database developers are working on the same database or repository. These options force database developers to provide commit comments when committing changes to the source control repository. This way, commit content can be recognized by anyone without exploring the changeset:
Besides the comments; this database source control tool has the integrated merging tool, which, by default, will show the difference in blocks. This can be changed by choosing any other options from the Default merging tool drop-down list (to use any of the merging tools, they have to be installed first):
Under the Script options tab in the Options window, all ignore and synchronization options set in the Source control setup window during the linking process for every linked database can be changed. Before changing these options, the SQL Server where the linked database is stored and the linked database must be chosen:
The Administration tab will become available when, on the connected SQL Server, a database linked in the shared development model is present. The Optional policy is the default policy for the databases linked in the shared development model. This policy means that every database developer working on that database can make any changes against the database objects without having to check out or check out and lock it first. In the Database development policies article, more information could be found about other policies:
Under the Shortcut tab, all keyboard shortcuts for this database source control tool will be listed. By default, they are all checked, which means that they can be applied at any point of time after the database is linked to the source control repository:
User default database source control options
All default options are stored as ApexSQL defaults. If any of the default options are changed and they need to be reverted to their default state, click on the ApexSQL defaults button. This has to be done one tab at the time:
This database source control tool provides every database developer to save its settings just by click on the Save as my defaults button. To use those option settings, simply click on the My defaults button: