How to set DriftOptionBlockDataLoss to false in VSTS release plugin
mdbouk
Posts: 2 New member
I'm running the latest SQL change automation vsts plugin. I added a new migration script doing the following
ALTER my_table ADD [description] varchar(max) NULL
When the release is been deployed i got the following error
ALTER my_table ADD [description] varchar(max) NULL
When the release is been deployed i got the following error
System.Management.Automation.CmdletInvocationException: An unhandled error occurred: RedGate.Versioning.Engine.Api.Exceptions.FileException: Drift analysis: These changes will NOT be applied because DriftOptionBlockDataLoss=True (see 'C:\WINDOWS\TEMP\DLM Automation\5dyfpy0w.ary\artifacts\SQL.Database.Migration_Database_DriftSyncScript.sql' for details). Changes have been detected that could result in data loss for the following table object(s): [dbo].[my_table].
I know how to disable the DriftOptionBlockDataLoss using the MSBuild way but not in the vsts release plugin.
Also a question here, why adding a null column will raise the data loss error? I'm just adding a null column
Please advice
I know how to disable the DriftOptionBlockDataLoss using the MSBuild way but not in the vsts release plugin.
Also a question here, why adding a null column will raise the data loss error? I'm just adding a null column
Please advice
Answers
Next, I added an index on the target, then added another new column on the dev side and deployed it. This also succeeded, even though there was drift on this table.
Could you have otherwise altered this table (my_table), between deployments? I'm wondering what drift check you're catching. If you run a SQL Compare from the dev db to the prod one (or target), what comes back?
I couldn't test back your solution, what I did is to run MSBuild task to build the SQL Change Automation project.
I will check back the SQL Change Automation Release task later and see what will happen