Presentation is loading. Please wait.

Presentation is loading. Please wait.

Migrations v2 Source Target. VersionScript 1… 2… Migrations v2 Source Target VersionScript 1… 2… 3… 4…

Similar presentations


Presentation on theme: "Migrations v2 Source Target. VersionScript 1… 2… Migrations v2 Source Target VersionScript 1… 2… 3… 4…"— Presentation transcript:

1 Migrations v2 Source Target

2 VersionScript 1… 2… Migrations v2 Source Target VersionScript 1… 2… 3… 4…

3 VersionScript 1… 2… 3… 4… Migrations v2 Source Target VersionScript 1… 2… 3… 4… Step 1 1.Deploy and execute migration scripts

4 VersionScript 1… 2… 3… 4… Migrations v2 Source Target VersionScript 1… 2… 3… 4… 1.Deploy and execute migration scripts 2.Use SQL Compare to deploy remaining changes Step 1 Step 2

5 VersionScript 1… 2… 3… 4… Migrations v2 Source Target VersionScript 1… 2… 3… 4… 1.Deploy and execute migration scripts 2.Use SQL Compare to deploy remaining changes Step 1 Step 2 BEGIN TRANSACTION COMMIT TRANSACTION

6 Migrations v2 Example migration script IF some condition BEGIN EXEC some script END

7 Migrations v2 Example migration script (renaming MyTable to MyTable2) BIT = 1 IF (old dbo.MyTable does not exist) BEGIN = 0; END = 1 BEGIN EXEC sp_rename END

8 Migrations v2 Example migration script (renaming MyTable to MyTable2) BIT = 1 IF NOT EXISTS (SELECT 1 FROM [information_schema].[Tables] WHERE table_schema = 'dbo' AND TABLE_NAME = ‘MyTable') BEGIN = 0; PRINT 'Object ''[dbo].[MyTable]'' could not be found - skipping migration.'; END = 1 BEGIN EXEC sp_rename '[dbo].[MyTable]', 'MyTable2' END

9 VersionScript 1… 2… 3… 4… Migrations v2 Source Target VersionScript 1… 2… 3… 4… 1.Deploy and execute migration scripts 2.Use SQL Compare to deploy remaining changes Step 1 Step 2 BEGIN TRANSACTION COMMIT TRANSACTION


Download ppt "Migrations v2 Source Target. VersionScript 1… 2… Migrations v2 Source Target VersionScript 1… 2… 3… 4…"

Similar presentations


Ads by Google