From b30926b273dead5d94159f54680c7a70b5966e2f Mon Sep 17 00:00:00 2001 From: udeeshagautam <46980425+udeeshagautam@users.noreply.github.com> Date: Fri, 24 May 2019 10:51:21 -0700 Subject: [PATCH] Adding some default values to match SSDT and other tools (#818) * Adding some default values to match DacFx deploy Extension and other tools. This help the default behavior but doesn't fix the issue. * Fixing a test for default values and adding comment --- .../SchemaCompare/Contracts/DeploymentOptions.cs | 12 ++++++++++++ .../SchemaCompareServiceOptionsTests.cs | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/Contracts/DeploymentOptions.cs b/src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/Contracts/DeploymentOptions.cs index 5c6e7018..c5e658da 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/Contracts/DeploymentOptions.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/Contracts/DeploymentOptions.cs @@ -207,6 +207,18 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare.Contracts public DeploymentOptions() { DacDeployOptions options = new DacDeployOptions(); + + // Adding these defaults to ensure behavior similarity with other tools. Dacfx and SSMS import/export wizards use these defaults. + // Tracking the full fix : https://github.com/microsoft/azuredatastudio/issues/5599 + options.AllowDropBlockingAssemblies = true; + options.AllowIncompatiblePlatform = true; + options.DropObjectsNotInSource = true; + options.DropPermissionsNotInSource = true; + options.DropRoleMembersNotInSource = true; + options.IgnoreKeywordCasing = false; + options.IgnoreSemicolonBetweenStatements = false; + options.IgnoreWhitespace = false; + System.Reflection.PropertyInfo[] deploymentOptionsProperties = this.GetType().GetProperties(); foreach (var deployOptionsProp in deploymentOptionsProperties) diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/SchemaCompare/SchemaCompareServiceOptionsTests.cs b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/SchemaCompare/SchemaCompareServiceOptionsTests.cs index 9c0c95f7..f30b4f2e 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/SchemaCompare/SchemaCompareServiceOptionsTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/SchemaCompare/SchemaCompareServiceOptionsTests.cs @@ -372,6 +372,16 @@ END DeploymentOptions deployOptions = new DeploymentOptions(); DacDeployOptions dacOptions = new DacDeployOptions(); + // Changes to match new defaults + dacOptions.AllowDropBlockingAssemblies = true; + dacOptions.AllowIncompatiblePlatform = true; + dacOptions.DropObjectsNotInSource = true; + dacOptions.DropPermissionsNotInSource = true; + dacOptions.DropRoleMembersNotInSource = true; + dacOptions.IgnoreKeywordCasing = false; + dacOptions.IgnoreSemicolonBetweenStatements = false; + dacOptions.IgnoreWhitespace = false; + System.Reflection.PropertyInfo[] deploymentOptionsProperties = deployOptions.GetType().GetProperties(); System.Reflection.PropertyInfo[] ddProperties = dacOptions.GetType().GetProperties();