Upgrading from old versions of migration scripts
Published 16 July 2015
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:
- Link SQL Source Control to the database repository and the related migrations repository.
- 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:
- In the SQL Source Control window, go to the Commit tab.
- Using the checkboxes, select all existing migration scripts.
- Enter a comment for the commit (eg Upgrade migration scripts to new format).
- Click commit.
The migration scripts now appear on the migrations tab, and you can use them with the new migrations feature.
To get started writing your own migration scripts, try this worked example.
For further support, or to give us feedback, please get in touch.