SQL Source Control 5

Upgrading from old versions of migration scripts

If you've manually enabled a previous beta version of the migrations feature, see V2 beta migration scripts.

Migration scripts were first introduced in SQL Source Control 3. An opt-in beta version of the feature is available in SQL Source Control 3.7 and later. This beta is disabled by default, and has to be manually enabled.

Before installing SQL Source Control 5

All repository users should update to SQL Source Control at the same time. Repositories with existing migration scripts need to be linked before updating to SQL Source Control 5.

For each repository:

  1. Link SQL Source Control to the database repository and the related migrations repository.
  2. Use Get latest to update to the latest revision for each repository.

Migration script folders that aren't linked won't be available after you update SQL Source Control 5.

Upgrade existing scripts

After installing SQL Source Control 5, existing migration scripts are displayed on the Commit tab for each repository. You won't be able to use them until they're upgraded.

This upgrade process only needs to be performed by one user per repository. All other repository users must then refresh the Commit tab.

The upgrade process may take a long time - it's proportional to the number of migration scripts to be upgraded, and can take two or three minutes per migration script. If you have a large number of existing migration scripts, we recommend that you wait until a suitable time before starting the upgrade process.

To upgrade existing migration scripts:

  1. In the SQL Source Control window, go to the Commit tab.
  2. Using the checkboxes, select all existing migration scripts.
  3. Enter a comment for the commit (eg Upgrade migration scripts to new format).
  4. Click commit.

The migration scripts now appear on the migrations tab, and you can use them with the new migrations feature.

What next?

To get started writing your own migration scripts, try this worked example.

For further support, or to give us feedback, please get in touch.

Didn't find what you were looking for?