Even though the basic working options are the same when it comes to SQL Database and Azure SQL Database, there are some differences regarding the login/user settings. In the Azure SQL Database environment, there can be only one server admin, and it cannot be changed. Also, any other user will not have the same level of the Server permissions, and they cannot be granted as well.
Based on this, database source control for Azure SQL Database will be a little bit different than for SQL Database when it comes to creating additional source control objects and location of them based on the linked database. More about necessary database source control permissions for Azure SQL Database can be found in the Minimal permissions for Azure SQL Database in database source control article.
Since the creation of those additional source control objects, called the framework objects, depends on the chosen development model during the linking a database to source control repository process, to explain them, in this article will be linked two databases (Test_01 and Test_02), one in the dedicated development model and the other in the shared development model.
The first step in the database source control for Azure SQL Database is linking it to the source control repository. Right-click on a database in the Object Explorer panel, in our case on the Test_01 database, and from the context menu, choose the Link database to source control command:
In the Source control setup window, the default tab that will be shown is the Connection type tab. No matter which option is chosen under this tab, the native solution (linking a database to any of the supported source control systems) or working folder (linking a database to a local folder without the need for source control system), it will not have any effect on the framework objects creation, it will affect only on the type of information needed under the System login tab in order to successfully link a database to source control repository.
Based on that, in this example, the native solution will be selected, and from the Source control system drop-down list, the Git source control system will be chosen.
Click the Next button to proceed:
Under the Development model tab, the development model for database source control must be chosen. Based on the chosen development model the specific framework objects will be created. Since in this example the database should be linked in the dedicated development model, that option will be chosen:
All information from this point on related to the linking a database to source control repository, the first steps for database source control, can be found in the How to link a SQL Server database to source control system article.
After the linking part is done, and the database is linked to the source control repository, the database and all linked object from that database icons in the Object Explorer panel will be changed:
This applies that for the chosen dedicated development model, the following framework objects are created in the linked database:
The shared development model applies to multiple database developers that are working at the same time on the same shared database. For this development model, ApexSQL Source Control supports more options that are very helpful when it comes to database development in this type of environment. Based on that, more information will be tracked for database source control, which applies that more framework objects will be created.
The first step is to link the chosen database to the source control repository in the shared development model, in our case, the Test_02 database. The only difference between linking it to the dedicated or shared development model, besides the needed permissions, is in the Development model tab in the Source control setup window, so only that tab will be explained.
To link a database in the shared development model, the Shared option must be chosen under the Development model tab:
By default, when the Shared option is chosen, under the Database field will be written the name of the database that is in the linking process. This means the framework objects will be stored in the same database that is chosen for linking to source control repository, in our case it is the Test_02 database.
After the linking process is done, and the database icon is changed, the following framework objects will be created in the linked database under the ApexSQL_SourceControl schema:
Note: In the ApexSQL_SourceControl.ChangeLog table the changes will be only written if the Log changes option is enabled under the Administration tab of the Options window.
Even though the framework objects will be created for every linked Azure SQL Database in the database itself, based on the chosen development model, the different set of the framework objects will be created, the framework objects that will suit the chosen environment.
© ALL RIGHTS RESERVED. Feedback Conditions d’utilisation Confidentialité Cookie Preference Center