Link a database to SVN

The topic describes how to link a database to Subversion (SVN).

To link a database to SVN:

1. In Database Explorer, right-click the database you want to link and select Source Control > Link Database to Source Control.

Alternatively, on the top menu, select Database > Link Database to Source Control.

2. In the Link Database to Source Control dialog, in the Source control repository field, click Create New Repository.

Note

By default, dbForge Studio automatically selects the repository that was previously linked.

3. In the Source Control Repository Properties dialog, enter the required repository settings:

  • Set Source control system to Subversion (SVN).
  • Enter the Server URL, User name, and Password.
  • In the Database folder field, click the ellipsis (…) and choose the folder to store the SQL scripts.
  • By default, the selected folder name is used as the repository name. To specify a different name, enter it manually.

Note

When you create a new project, the Database folder defines the directory that contains only the database files. Any SQL files added to this folder are automatically included in project analysis and comparison operations.

To avoid errors caused by duplicate files, store database files in a separate folder from other scripts and resources, for example, at a different folder level.

Example:

If the Database folder is set to $/SourceControlSQLServer/AdventureWorks2022:

  • SourceControlSQLServer (Level 1) contains additional scripts and resources.

  • AdventureWorks2022 (Level 2) contains only the database files used by the version control system.

Configure the repository settings

4. Optional: To verify the repository settings, click Test.

5. To save the settings and close the dialog, click OK.

6. Choose a database development model:

  • Shared – Developers collaborate on a single shared database.
  • Dedicated – Each developer works on a local copy of the database.

7. To connect the database to the repository, click Link.

Connect the database to the repository

The Refresh window opens and displays the progress of the refresh operation.

After the database is linked, it appears in Database Explorer with the source control icon:

Linked database in Database Explorer

Set up version control after linking

After linking the database, your next step depends on whether the repository is new or already in use by your team:

  • If this is the first time the database is linked:

In the Local changes section of the Source Control Manager, select the objects you want to add to version control, then click Commit.

For instructions, see Commit changes.

  • If the database is already under source control:

In the Remote changes section, select the objects you want to retrieve, then click Get Latest.

Note

The Get Latest option is available only in the dedicated development model.

For instructions, see Get the latest version.