diff --git a/extensions/mssql/src/contracts.ts b/extensions/mssql/src/contracts.ts index a378cac45b..8dd1aabd46 100644 --- a/extensions/mssql/src/contracts.ts +++ b/extensions/mssql/src/contracts.ts @@ -439,6 +439,7 @@ export interface SchemaCompareParams { sourceEndpointInfo: azdata.SchemaCompareEndpointInfo; targetEndpointInfo: azdata.SchemaCompareEndpointInfo; taskExecutionMode: TaskExecutionMode; + deploymentOptions: azdata.DeploymentOptions; } export interface SchemaCompareGenerateScriptParams { @@ -455,6 +456,17 @@ export interface SchemaComparePublishChangesParams { taskExecutionMode: TaskExecutionMode; } +export interface SchemaCompareGetOptionsParams { + +} + +export interface SchemaCompareNodeParams { + operationId: string; + diffEntry: azdata.DiffEntry; + includeRequest: boolean; + taskExecutionMode: TaskExecutionMode; +} + export namespace SchemaCompareRequest { export const type = new RequestType('schemaCompare/compare'); } @@ -466,4 +478,13 @@ export namespace SchemaCompareGenerateScriptRequest { export namespace SchemaComparePublishChangesRequest { export const type = new RequestType('schemaCompare/publish'); } + +export namespace SchemaCompareGetDefaultOptionsRequest { + export const type = new RequestType('schemaCompare/getDefaultOptions'); +} + +export namespace SchemaCompareIncludeExcludeNodeRequest { + export const type = new RequestType('schemaCompare/includeExcludeNode'); +} + // ------------------------------- ----------------------------- diff --git a/extensions/mssql/src/features.ts b/extensions/mssql/src/features.ts index f3fcb93265..96e29a7cfd 100644 --- a/extensions/mssql/src/features.ts +++ b/extensions/mssql/src/features.ts @@ -145,7 +145,9 @@ export class DacFxServicesFeature extends SqlOpsFeature { export class SchemaCompareServicesFeature extends SqlOpsFeature { private static readonly messageTypes: RPCMessageType[] = [ contracts.SchemaCompareRequest.type, - contracts.SchemaCompareGenerateScriptRequest.type + contracts.SchemaCompareGenerateScriptRequest.type, + contracts.SchemaCompareGetDefaultOptionsRequest.type, + contracts.SchemaCompareIncludeExcludeNodeRequest.type ]; constructor(client: SqlOpsDataClient) { @@ -165,8 +167,8 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature { protected registerProvider(options: undefined): Disposable { const client = this._client; - let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { - let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode }; + let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions): Thenable => { + let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode, deploymentOptions: deploymentOptions }; return client.sendRequest(contracts.SchemaCompareRequest.type, params).then( r => { return r; @@ -204,11 +206,39 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature { ); }; + let schemaCompareGetDefaultOptions = (): Thenable => { + let params: contracts.SchemaCompareGetOptionsParams = {}; + return client.sendRequest(contracts.SchemaCompareGetDefaultOptionsRequest.type, params).then( + r => { + return r; + }, + e => { + client.logFailedRequest(contracts.SchemaCompareGetDefaultOptionsRequest.type, e); + return Promise.resolve(undefined); + } + ); + }; + + let schemaCompareIncludeExcludeNode = (operationId: string, diffEntry: azdata.DiffEntry, includeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { + let params: contracts.SchemaCompareNodeParams = { operationId: operationId, diffEntry, includeRequest, taskExecutionMode: taskExecutionMode }; + return client.sendRequest(contracts.SchemaCompareIncludeExcludeNodeRequest.type, params).then( + r => { + return r; + }, + e => { + client.logFailedRequest(contracts.SchemaCompareIncludeExcludeNodeRequest.type, e); + return Promise.resolve(undefined); + } + ); + }; + return azdata.dataprotocol.registerSchemaCompareServicesProvider({ providerId: client.providerId, schemaCompare, schemaCompareGenerateScript, - schemaComparePublishChanges + schemaComparePublishChanges, + schemaCompareGetDefaultOptions, + schemaCompareIncludeExcludeNode }); } } diff --git a/extensions/schema-compare/src/dialogs/schemaCompareOptionsDialog.ts b/extensions/schema-compare/src/dialogs/schemaCompareOptionsDialog.ts new file mode 100644 index 0000000000..0f23602b78 --- /dev/null +++ b/extensions/schema-compare/src/dialogs/schemaCompareOptionsDialog.ts @@ -0,0 +1,1714 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as nls from 'vscode-nls'; +import * as azdata from 'azdata'; +import * as vscode from 'vscode'; + +const localize = nls.loadMessageBundle(); + +export class SchemaCompareOptionsDialog { + private static readonly OkButtonText: string = localize('SchemaCompareOptionsDialog.Ok', 'Ok'); + private static readonly CancelButtonText: string = localize('SchemaCompareOptionsDialog.Cancel', 'Cancel'); + private static readonly OptionsLabel: string = localize('SchemaCompare.SchemaCompareOptionsDialogLabel', 'Schema Compare Options'); + private static readonly GeneralOptionsLabel: string = localize('SchemaCompare.GeneralOptionsLabel', 'General Options'); + private static readonly ObjectTypesOptionsLabel: string = localize('SchemaCompare.ObjectTypesOptionsLabel', 'Include Object Types'); + + private static readonly IgnoreTableOptions: string = localize('SchemaCompare.IgnoreTableOptions', 'Ignore Table Options'); + private static readonly IgnoreSemicolonBetweenStatements: string = localize('SchemaCompare.IgnoreSemicolonBetweenStatements', 'Ignore Semicolon Between Statements'); + private static readonly IgnoreRouteLifetime: string = localize('SchemaCompare.IgnoreRouteLifetime', 'Ignore Route Lifetime'); + private static readonly IgnoreRoleMembership: string = localize('SchemaCompare.IgnoreRoleMembership', 'Ignore Role Membership'); + private static readonly IgnoreQuotedIdentifiers: string = localize('SchemaCompare.IgnoreQuotedIdentifiers', 'Ignore Quoted Identifiers'); + private static readonly IgnorePermissions: string = localize('SchemaCompare.IgnorePermissions', 'Ignore Permissions'); + private static readonly IgnorePartitionSchemes: string = localize('SchemaCompare.IgnorePartitionSchemes', 'Ignore Partition Schemes'); + private static readonly IgnoreObjectPlacementOnPartitionScheme: string = localize('SchemaCompare.IgnoreObjectPlacementOnPartitionScheme', 'Ignore Object Placement On Partition Scheme'); + private static readonly IgnoreNotForReplication: string = localize('SchemaCompare.IgnoreNotForReplication', 'Ignore Not For Replication'); + private static readonly IgnoreLoginSids: string = localize('SchemaCompare.IgnoreLoginSids', 'Ignore Login Sids'); + private static readonly IgnoreLockHintsOnIndexes: string = localize('SchemaCompare.IgnoreLockHintsOnIndexes', 'Ignore Lock Hints On Indexes'); + private static readonly IgnoreKeywordCasing: string = localize('SchemaCompare.IgnoreKeywordCasing', 'Ignore Keyword Casing'); + private static readonly IgnoreIndexPadding: string = localize('SchemaCompare.IgnoreIndexPadding', 'Ignore Index Padding'); + private static readonly IgnoreIndexOptions: string = localize('SchemaCompare.IgnoreIndexOptions', 'Ignore Index Options'); + private static readonly IgnoreIncrement: string = localize('SchemaCompare.IgnoreIncrement', 'Ignore Increment'); + private static readonly IgnoreIdentitySeed: string = localize('SchemaCompare.IgnoreIdentitySeed', 'Ignore Identity Seed'); + private static readonly IgnoreUserSettingsObjects: string = localize('SchemaCompare.IgnoreUserSettingsObjects', 'Ignore User Settings Objects'); + private static readonly IgnoreFullTextCatalogFilePath: string = localize('SchemaCompare.IgnoreFullTextCatalogFilePath', 'Ignore Full Text Catalog FilePath'); + private static readonly IgnoreWhitespace: string = localize('SchemaCompare.IgnoreWhitespace', 'Ignore Whitespace'); + private static readonly IgnoreWithNocheckOnForeignKeys: string = localize('SchemaCompare.IgnoreWithNocheckOnForeignKeys', 'Ignore With Nocheck On ForeignKeys'); + private static readonly VerifyCollationCompatibility: string = localize('SchemaCompare.VerifyCollationCompatibility', 'Verify Collation Compatibility'); + private static readonly UnmodifiableObjectWarnings: string = localize('SchemaCompare.UnmodifiableObjectWarnings', 'Unmodifiable Object Warnings'); + private static readonly TreatVerificationErrorsAsWarnings: string = localize('SchemaCompare.TreatVerificationErrorsAsWarnings', 'Treat Verification Errors As Warnings'); + private static readonly ScriptRefreshModule: string = localize('SchemaCompare.ScriptRefreshModule', 'Script Refresh Module'); + private static readonly ScriptNewConstraintValidation: string = localize('SchemaCompare.ScriptNewConstraintValidation', 'Script New Constraint Validation'); + private static readonly ScriptFileSize: string = localize('SchemaCompare.ScriptFileSize', 'Script File Size'); + private static readonly ScriptDeployStateChecks: string = localize('SchemaCompare.ScriptDeployStateChecks', 'Script Deploy StateChecks'); + private static readonly ScriptDatabaseOptions: string = localize('SchemaCompare.ScriptDatabaseOptions', 'Script Database Options'); + private static readonly ScriptDatabaseCompatibility: string = localize('SchemaCompare.ScriptDatabaseCompatibility', 'Script Database Compatibility'); + private static readonly ScriptDatabaseCollation: string = localize('SchemaCompare.ScriptDatabaseCollation', 'Script Database Collation'); + private static readonly RunDeploymentPlanExecutors: string = localize('SchemaCompare.RunDeploymentPlanExecutors', 'Run Deployment Plan Executors'); + private static readonly RegisterDataTierApplication: string = localize('SchemaCompare.RegisterDataTierApplication', 'Register DataTier Application'); + private static readonly PopulateFilesOnFileGroups: string = localize('SchemaCompare.PopulateFilesOnFileGroups', 'Populate Files On File Groups'); + private static readonly NoAlterStatementsToChangeClrTypes: string = localize('SchemaCompare.NoAlterStatementsToChangeClrTypes', 'No Alter Statements To Change Clr Types'); + private static readonly IncludeTransactionalScripts: string = localize('SchemaCompare.IncludeTransactionalScripts', 'Include Transactional Scripts'); + private static readonly IncludeCompositeObjects: string = localize('SchemaCompare.IncludeCompositeObjects', 'Include Composite Objects'); + private static readonly AllowUnsafeRowLevelSecurityDataMovement: string = localize('SchemaCompare.AllowUnsafeRowLevelSecurityDataMovement', 'Allow Unsafe Row Level Security Data Movement'); + private static readonly IgnoreWithNocheckOnCheckConstraints: string = localize('SchemaCompare.IgnoreWithNocheckOnCheckConstraints', 'Ignore With No check On Check Constraints'); + private static readonly IgnoreFillFactor: string = localize('SchemaCompare.IgnoreFillFactor', 'Ignore Fill Factor'); + private static readonly IgnoreFileSize: string = localize('SchemaCompare.IgnoreFileSize', 'Ignore File Size'); + private static readonly IgnoreFilegroupPlacement: string = localize('SchemaCompare.IgnoreFilegroupPlacement', 'Ignore Filegroup Placement'); + private static readonly DoNotAlterReplicatedObjects: string = localize('SchemaCompare.DoNotAlterReplicatedObjects', 'Do Not Alter Replicated Objects'); + private static readonly DoNotAlterChangeDataCaptureObjects: string = localize('SchemaCompare.DoNotAlterChangeDataCaptureObjects', 'Do Not Alter Change Data Capture Objects'); + private static readonly DisableAndReenableDdlTriggers: string = localize('SchemaCompare.DisableAndReenableDdlTriggers', 'Disable And Reenable Ddl Triggers'); + private static readonly DeployDatabaseInSingleUserMode: string = localize('SchemaCompare.DeployDatabaseInSingleUserMode', 'Deploy Database In Single User Mode'); + private static readonly CreateNewDatabase: string = localize('SchemaCompare.CreateNewDatabase', 'Create New Database'); + private static readonly CompareUsingTargetCollation: string = localize('SchemaCompare.CompareUsingTargetCollation', 'Compare Using Target Collation'); + private static readonly CommentOutSetVarDeclarations: string = localize('SchemaCompare.CommentOutSetVarDeclarations', 'Comment Out Set Var Declarations'); + private static readonly BlockWhenDriftDetected: string = localize('SchemaCompare.BlockWhenDriftDetected', 'Block When Drift Detected'); + private static readonly BlockOnPossibleDataLoss: string = localize('SchemaCompare.BlockOnPossibleDataLoss', 'Block On Possible Data Loss'); + private static readonly BackupDatabaseBeforeChanges: string = localize('SchemaCompare.BackupDatabaseBeforeChanges', 'Backup Database Before Changes'); + private static readonly AllowIncompatiblePlatform: string = localize('SchemaCompare.AllowIncompatiblePlatform', 'Allow Incompatible Platform'); + private static readonly AllowDropBlockingAssemblies: string = localize('SchemaCompare.AllowDropBlockingAssemblies', 'Allow Drop Blocking Assemblies'); + private static readonly DropConstraintsNotInSource: string = localize('SchemaCompare.DropConstraintsNotInSource', 'Drop Constraints Not In Source'); + private static readonly DropDmlTriggersNotInSource: string = localize('SchemaCompare.DropDmlTriggersNotInSource', 'Drop Dml Triggers Not In Source'); + private static readonly DropExtendedPropertiesNotInSource: string = localize('SchemaCompare.DropExtendedPropertiesNotInSource', 'Drop Extended Properties Not In Source'); + private static readonly DropIndexesNotInSource: string = localize('SchemaCompare.DropIndexesNotInSource', 'Drop Indexes Not In Source'); + private static readonly IgnoreFileAndLogFilePath: string = localize('SchemaCompare.IgnoreFileAndLogFilePath', 'Ignore File And Log File Path'); + private static readonly IgnoreExtendedProperties: string = localize('SchemaCompare.IgnoreExtendedProperties', 'Ignore Extended Properties'); + private static readonly IgnoreDmlTriggerState: string = localize('SchemaCompare.IgnoreDmlTriggerState', 'Ignore Dml Trigger State'); + private static readonly IgnoreDmlTriggerOrder: string = localize('SchemaCompare.IgnoreDmlTriggerOrder', 'Ignore Dml Trigger Order'); + private static readonly IgnoreDefaultSchema: string = localize('SchemaCompare.IgnoreDefaultSchema', 'Ignore Default Schema'); + private static readonly IgnoreDdlTriggerState: string = localize('SchemaCompare.IgnoreDdlTriggerState', 'Ignore Ddl Trigger State'); + private static readonly IgnoreDdlTriggerOrder: string = localize('SchemaCompare.IgnoreDdlTriggerOrder', 'Ignore Ddl Trigger Order'); + private static readonly IgnoreCryptographicProviderFilePath: string = localize('SchemaCompare.IgnoreCryptographicProviderFilePath', 'Ignore Cryptographic Provider FilePath'); + private static readonly VerifyDeployment: string = localize('SchemaCompare.VerifyDeployment', 'Verify Deployment'); + private static readonly IgnoreComments: string = localize('SchemaCompare.IgnoreComments', 'Ignore Comments'); + private static readonly IgnoreColumnCollation: string = localize('SchemaCompare.IgnoreColumnCollation', 'Ignore Column Collation'); + private static readonly IgnoreAuthorizer: string = localize('SchemaCompare.IgnoreAuthorizer', 'Ignore Authorizer'); + private static readonly IgnoreAnsiNulls: string = localize('SchemaCompare.IgnoreAnsiNulls', 'Ignore AnsiNulls'); + private static readonly GenerateSmartDefaults: string = localize('SchemaCompare.GenerateSmartDefaults', 'Generate SmartDefaults'); + private static readonly DropStatisticsNotInSource: string = localize('SchemaCompare.DropStatisticsNotInSource', 'Drop Statistics Not In Source'); + private static readonly DropRoleMembersNotInSource: string = localize('SchemaCompare.DropRoleMembersNotInSource', 'Drop Role Members Not In Source'); + private static readonly DropPermissionsNotInSource: string = localize('SchemaCompare.DropPermissionsNotInSource', 'Drop Permissions Not In Source'); + private static readonly DropObjectsNotInSource: string = localize('SchemaCompare.DropObjectsNotInSource', 'Drop Objects Not In Source'); + private static readonly IgnoreColumnOrder: string = localize('SchemaCompare.IgnoreColumnOrder', 'Ignore Column Order'); + + private static readonly Aggregates: string = localize('SchemaCompare.Aggregates', 'Aggregates'); + private static readonly ApplicationRoles: string = localize('SchemaCompare.ApplicationRoles', 'Application Roles'); + private static readonly Assemblies: string = localize('SchemaCompare.Assemblies', 'Assemblies'); + private static readonly AssemblyFiles: string = localize('SchemaCompare.AssemblyFiles', 'Assembly Files'); + private static readonly AsymmetricKeys: string = localize('SchemaCompare.AsymmetricKeys', 'Asymmetric Keys'); + private static readonly BrokerPriorities: string = localize('SchemaCompare.BrokerPriorities', 'Broker Priorities'); + private static readonly Certificates: string = localize('SchemaCompare.Certificates', 'Certificates'); + private static readonly ColumnEncryptionKeys: string = localize('SchemaCompare.ColumnEncryptionKeys', 'Column Encryption Keys'); + private static readonly ColumnMasterKeys: string = localize('SchemaCompare.ColumnMasterKeys', 'Column Master Keys'); + private static readonly Contracts: string = localize('SchemaCompare.Contracts', 'Contracts'); + private static readonly DatabaseOptions: string = localize('SchemaCompare.DatabaseOptions', 'Database Options'); + private static readonly DatabaseRoles: string = localize('SchemaCompare.DatabaseRoles', 'Database Roles'); + private static readonly DatabaseTriggers: string = localize('SchemaCompare.DatabaseTriggers', 'DatabaseTriggers'); + private static readonly Defaults: string = localize('SchemaCompare.Defaults', 'Defaults'); + private static readonly ExtendedProperties: string = localize('SchemaCompare.ExtendedProperties', 'Extended Properties'); + private static readonly ExternalDataSources: string = localize('SchemaCompare.ExternalDataSources', 'External Data Sources'); + private static readonly ExternalFileFormats: string = localize('SchemaCompare.ExternalFileFormats', 'External File Formats'); + private static readonly ExternalTables: string = localize('SchemaCompare.ExternalTables', 'External Tables'); + private static readonly Filegroups: string = localize('SchemaCompare.Filegroups', 'Filegroups'); + private static readonly FileTables: string = localize('SchemaCompare.FileTables', 'File Tables'); + private static readonly FullTextCatalogs: string = localize('SchemaCompare.FullTextCatalogs', 'Full Text Catalogs'); + private static readonly FullTextStoplists: string = localize('SchemaCompare.FullTextStoplists', 'Full Text Stoplists'); + private static readonly MessageTypes: string = localize('SchemaCompare.MessageTypes', 'Message Types'); + private static readonly PartitionFunctions: string = localize('SchemaCompare.PartitionFunctions', 'Partition Functions'); + private static readonly PartitionSchemes: string = localize('SchemaCompare.PartitionSchemes', 'Partition Schemes'); + private static readonly Permissions: string = localize('SchemaCompare.Permissions', 'Permissions'); + private static readonly Queues: string = localize('SchemaCompare.Queues', 'Queues'); + private static readonly RemoteServiceBindings: string = localize('SchemaCompare.RemoteServiceBindings', 'Remote Service Bindings'); + private static readonly RoleMembership: string = localize('SchemaCompare.RoleMembership', 'Role Membership'); + private static readonly Rules: string = localize('SchemaCompare.Rules', 'Rules'); + private static readonly ScalarValuedFunctions: string = localize('SchemaCompare.ScalarValuedFunctions', 'Scalar Valued Functions'); + private static readonly SearchPropertyLists: string = localize('SchemaCompare.SearchPropertyLists', 'Search Property Lists'); + private static readonly SecurityPolicies: string = localize('SchemaCompare.SecurityPolicies', 'Security Policies'); + private static readonly Sequences: string = localize('SchemaCompare.Sequences', 'Sequences'); + private static readonly Services: string = localize('SchemaCompare.Services', 'Services'); + private static readonly Signatures: string = localize('SchemaCompare.Signatures', 'Signatures'); + private static readonly StoredProcedures: string = localize('SchemaCompare.StoredProcedures', 'StoredProcedures'); + private static readonly SymmetricKeys: string = localize('SchemaCompare.SymmetricKeys', 'SymmetricKeys'); + private static readonly Synonyms: string = localize('SchemaCompare.Synonyms', 'Synonyms'); + private static readonly Tables: string = localize('SchemaCompare.Tables', 'Tables'); + private static readonly TableValuedFunctions: string = localize('SchemaCompare.TableValuedFunctions', 'Table Valued Functions'); + private static readonly UserDefinedDataTypes: string = localize('SchemaCompare.UserDefinedDataTypes', 'User Defined Data Types'); + private static readonly UserDefinedTableTypes: string = localize('SchemaCompare.UserDefinedTableTypes', 'User Defined Table Types'); + private static readonly ClrUserDefinedTypes: string = localize('SchemaCompare.ClrUserDefinedTypes', 'Clr User Defined Types'); + private static readonly Users: string = localize('SchemaCompare.Users', 'Users'); + private static readonly Views: string = localize('SchemaCompare.Views', 'Views'); + private static readonly XmlSchemaCollections: string = localize('SchemaCompare.XmlSchemaCollections', 'Xml Schema Collections'); + private static readonly Audits: string = localize('SchemaCompare.Audits', 'Audits'); + private static readonly Credentials: string = localize('SchemaCompare.Credentials', 'Credentials'); + private static readonly CryptographicProviders: string = localize('SchemaCompare.CryptographicProviders', 'Cryptographic Providers'); + private static readonly DatabaseAuditSpecifications: string = localize('SchemaCompare.DatabaseAuditSpecifications', 'Database Audit Specifications'); + private static readonly DatabaseEncryptionKeys: string = localize('SchemaCompare.DatabaseEncryptionKeys', 'Database Encryption Keys'); + private static readonly DatabaseScopedCredentials: string = localize('SchemaCompare.DatabaseScopedCredentials', 'Database Scoped Credentials'); + private static readonly Endpoints: string = localize('SchemaCompare.Endpoints', 'Endpoints'); + private static readonly ErrorMessages: string = localize('SchemaCompare.ErrorMessages', 'Error Messages'); + private static readonly EventNotifications: string = localize('SchemaCompare.EventNotifications', 'Event Notifications'); + private static readonly EventSessions: string = localize('SchemaCompare.EventSessions', 'Event Sessions'); + private static readonly LinkedServerLogins: string = localize('SchemaCompare.LinkedServerLogins', 'Linked Server Logins'); + private static readonly LinkedServers: string = localize('SchemaCompare.LinkedServers', 'Linked Servers'); + private static readonly Logins: string = localize('SchemaCompare.Logins', 'Logins'); + private static readonly MasterKeys: string = localize('SchemaCompare.MasterKeys', 'Master Keys'); + private static readonly Routes: string = localize('SchemaCompare.Routes', 'Routes'); + private static readonly ServerAuditSpecifications: string = localize('SchemaCompare.ServerAuditSpecifications', 'Server Audit Specifications'); + private static readonly ServerRoleMembership: string = localize('SchemaCompare.ServerRoleMembership', 'Server Role Membership'); + private static readonly ServerRoles: string = localize('SchemaCompare.ServerRoles', 'Server Roles'); + private static readonly ServerTriggers: string = localize('SchemaCompare.ServerTriggers', 'Server Triggers'); + + private static readonly descriptionIgnoreTableOptions: string = localize('SchemaCompare.Description.IgnoreTableOptions', 'Specifies whether differences in the table options will be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreSemicolonBetweenStatements: string = localize('SchemaCompare.Description.IgnoreSemicolonBetweenStatements', 'Specifies whether differences in the semi-colons between T-SQL statements will be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreRouteLifetime: string = localize('SchemaCompare.Description.IgnoreRouteLifetime', 'Specifies whether differences in the amount of time that SQL Server retains the route in the routing table should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreRoleMembership: string = localize('SchemaCompare.Description.IgnoreRoleMembership', 'Specifies whether differences in the role membership of logins should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreQuotedIdentifiers: string = localize('SchemaCompare.Description.IgnoreQuotedIdentifiers', 'Specifies whether differences in the quoted identifiers setting should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnorePermissions: string = localize('SchemaCompare.Description.IgnorePermissions', 'Specifies whether permissions should be ignored.'); + private static readonly descriptionIgnorePartitionSchemes: string = localize('SchemaCompare.Description.IgnorePartitionSchemes', 'Specifies whether differences in partition schemes and functions should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreObjectPlacementOnPartitionScheme: string = localize('SchemaCompare.Description.IgnoreObjectPlacementOnPartitionScheme', 'Specifies whether an object\'s placement on a partition scheme should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreNotForReplication: string = localize('SchemaCompare.Description.IgnoreNotForReplication', 'Specifies whether the not for replication settings should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreLoginSids: string = localize('SchemaCompare.Description.IgnoreLoginSids', 'Specifies whether differences in the security identification number (SID) should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreLockHintsOnIndexes: string = localize('SchemaCompare.Description.IgnoreLockHintsOnIndexes', 'Specifies whether differences in the lock hints on indexes should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreKeywordCasing: string = localize('SchemaCompare.Description.IgnoreKeywordCasing', 'Specifies whether differences in the casing of keywords should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreIndexPadding: string = localize('SchemaCompare.Description.IgnoreIndexPadding', 'Specifies whether differences in the index padding should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreIndexOptions: string = localize('SchemaCompare.Description.IgnoreIndexOptions', 'Specifies whether differences in the index options should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreIncrement: string = localize('SchemaCompare.Description.IgnoreIncrement', 'Specifies whether differences in the increment for an identity column should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreIdentitySeed: string = localize('SchemaCompare.Description.IgnoreIdentitySeed', 'Specifies whether differences in the seed for an identity column should be ignored or updated when you publish updates to a database.'); + private static readonly descriptionIgnoreUserSettingsObjects: string = localize('SchemaCompare.Description.IgnoreUserSettingsObjects', 'Specifies whether differences in the user settings objects will be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreFullTextCatalogFilePath: string = localize('SchemaCompare.Description.IgnoreFullTextCatalogFilePath', 'Specifies whether differences in the file path for the full-text catalog should be ignored or whether a warning should be issued when you publish to a database.'); + private static readonly descriptionIgnoreWhitespace: string = localize('SchemaCompare.Description.IgnoreWhitespace', 'Specifies whether differences in white space will be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreWithNocheckOnForeignKeys: string = localize('SchemaCompare.Description.IgnoreWithNocheckOnForeignKeys', 'Specifies whether differences in the value of the WITH NOCHECK clause for foreign keys will be ignored or updated when you publish to a database.'); + private static readonly descriptionVerifyCollationCompatibility: string = localize('SchemaCompare.Description.VerifyCollationCompatibility', 'Specifies whether collation compatibility is verified.'); + private static readonly descriptionUnmodifiableObjectWarnings: string = localize('SchemaCompare.Description.UnmodifiableObjectWarnings', 'Specifies whether warnings should be generated when differences are found in objects that cannot be modified, for example, if the file size or file paths were different for a file.'); + private static readonly descriptionTreatVerificationErrorsAsWarnings: string = localize('SchemaCompare.Description.TreatVerificationErrorsAsWarnings', 'Specifies whether errors encountered during publish verification should be treated as warnings. The check is performed against the generated deployment plan before the plan is executed against your target database. Plan verification detects problems such as the loss of target-only objects (such as indexes) that must be dropped to make a change. Verification will also detect situations where dependencies (such as a table or view) exist because of a reference to a composite project, but do not exist in the target database. You might choose to do this to get a complete list of all issues, instead of having the publish action stop on the first error.'); + private static readonly descriptionScriptRefreshModule: string = localize('SchemaCompare.Description.ScriptRefreshModule', 'Include refresh statements at the end of the publish script.'); + private static readonly descriptionScriptNewConstraintValidation: string = localize('SchemaCompare.Description.ScriptNewConstraintValidation', 'At the end of publish all of the constraints will be verified as one set, avoiding data errors caused by a check or foreign key constraint in the middle of publish. If set to False, your constraints will be published without checking the corresponding data.'); + private static readonly descriptionScriptFileSize: string = localize('SchemaCompare.Description.ScriptFileSize', 'Controls whether size is specified when adding a file to a filegroup.'); + private static readonly descriptionScriptDeployStateChecks: string = localize('SchemaCompare.Description.ScriptDeployStateChecks', 'Specifies whether statements are generated in the publish script to verify that the database name and server name match the names specified in the database project.'); + private static readonly descriptionScriptDatabaseOptions: string = localize('SchemaCompare.Description.ScriptDatabaseOptions', 'Specifies whether target database properties should be set or updated as part of the publish action.'); + private static readonly descriptionScriptDatabaseCompatibility: string = localize('SchemaCompare.Description.ScriptDatabaseCompatibility', 'Specifies whether differences in the database compatibility should be ignored or updated when you publish to a database.'); + private static readonly descriptionScriptDatabaseCollation: string = localize('SchemaCompare.Description.ScriptDatabaseCollation', 'Specifies whether differences in the database collation should be ignored or updated when you publish to a database.'); + private static readonly descriptionRunDeploymentPlanExecutors: string = localize('SchemaCompare.Description.RunDeploymentPlanExecutors', 'Specifies whether DeploymentPlanExecutor contributors should be run when other operations are executed.'); + private static readonly descriptionRegisterDataTierApplication: string = localize('SchemaCompare.Description.RegisterDataTierApplication', 'Specifies whether the schema is registered with the database server.'); + private static readonly descriptionPopulateFilesOnFileGroups: string = localize('SchemaCompare.Description.PopulateFilesOnFileGroups', 'Specifies whether a new file is also created when a new FileGroup is created in the target database.'); + private static readonly descriptionNoAlterStatementsToChangeClrTypes: string = localize('SchemaCompare.Description.NoAlterStatementsToChangeClrTypes', 'Specifies that publish should always drop and re-create an assembly if there is a difference instead of issuing an ALTER ASSEMBLY statement'); + private static readonly descriptionIncludeTransactionalScripts: string = localize('SchemaCompare.Description.IncludeTransactionalScripts', 'Specifies whether transactional statements should be used where possible when you publish to a database.'); + private static readonly descriptionIncludeCompositeObjects: string = localize('SchemaCompare.Description.IncludeCompositeObjects', 'Include all composite elements as part of a single publish operation.'); + private static readonly descriptionAllowUnsafeRowLevelSecurityDataMovement: string = localize('SchemaCompare.Description.AllowUnsafeRowLevelSecurityDataMovement', 'Do not block data motion on a table which has Row Level Security if this property is set to true. Default is false.'); + private static readonly descriptionIgnoreWithNocheckOnCheckConstraints: string = localize('SchemaCompare.Description.IgnoreWithNocheckOnCheckConstraints', 'Specifies whether differences in the value of the WITH NOCHECK clause for check constraints will be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreFillFactor: string = localize('SchemaCompare.Description.IgnoreFillFactor', 'Specifies whether differences in the fill factor for index storage should be ignored or whether a warning should be issued when you publish to a database.'); + private static readonly descriptionIgnoreFileSize: string = localize('SchemaCompare.Description.IgnoreFileSize', 'Specifies whether differences in the file sizes should be ignored or whether a warning should be issued when you publish to a database.'); + private static readonly descriptionIgnoreFilegroupPlacement: string = localize('SchemaCompare.Description.IgnoreFilegroupPlacement', 'Specifies whether differences in the placement of objects in FILEGROUPs should be ignored or updated when you publish to a database.'); + private static readonly descriptionDoNotAlterReplicatedObjects: string = localize('SchemaCompare.Description.DoNotAlterReplicatedObjects', 'Specifies whether objects that are replicated are identified during verification.'); + private static readonly descriptionDoNotAlterChangeDataCaptureObjects: string = localize('SchemaCompare.Description.DoNotAlterChangeDataCaptureObjects', 'If true, Change Data Capture objects are not altered.'); + private static readonly descriptionDisableAndReenableDdlTriggers: string = localize('SchemaCompare.Description.DisableAndReenableDdlTriggers', 'Specifies whether Data Definition Language (DDL) triggers are disabled at the beginning of the publish process and re-enabled at the end of the publish action.'); + private static readonly descriptionDeployDatabaseInSingleUserMode: string = localize('SchemaCompare.Description.DeployDatabaseInSingleUserMode', 'If true, the database is set to Single User Mode before deploying.'); + private static readonly descriptionCreateNewDatabase: string = localize('SchemaCompare.Description.CreateNewDatabase', 'Specifies whether the target database should be updated or whether it should be dropped and re-created when you publish to a database.'); + private static readonly descriptionCompareUsingTargetCollation: string = localize('SchemaCompare.Description.CompareUsingTargetCollation', 'This setting dictates how the database\'s collation is handled during deployment; by default the target database\'s collation will be updated if it does not match the collation specified by the source. When this option is set, the target database\'s (or server\'s) collation should be used.'); + private static readonly descriptionCommentOutSetVarDeclarations: string = localize('SchemaCompare.Description.CommentOutSetVarDeclarations', 'Specifies whether the declaration of SETVAR variables should be commented out in the generated publish script. You might choose to do this if you plan to specify the values on the command line when you publish by using a tool such as SQLCMD.EXE.'); + private static readonly descriptionBlockWhenDriftDetected: string = localize('SchemaCompare.Description.BlockWhenDriftDetected', 'Specifies whether to block updating a database whose schema no longer matches its registration or is unregistered.'); + private static readonly descriptionBlockOnPossibleDataLoss: string = localize('SchemaCompare.Description.BlockOnPossibleDataLoss', 'Specifies that the publish episode should be terminated if there is a possibility of data loss resulting from the publish operation.'); + private static readonly descriptionBackupDatabaseBeforeChanges: string = localize('SchemaCompare.Description.BackupDatabaseBeforeChanges', 'Backups the database before deploying any changes.'); + private static readonly descriptionAllowIncompatiblePlatform: string = localize('SchemaCompare.Description.AllowIncompatiblePlatform', 'Specifies whether to attempt the action despite incompatible SQL Server platforms.'); + private static readonly descriptionAllowDropBlockingAssemblies: string = localize('SchemaCompare.Description.AllowDropBlockingAssemblies', 'This property is used by SqlClr deployment to cause any blocking assemblies to be dropped as part of the deployment plan. By default, any blocking/referencing assemblies will block an assembly update if the referencing assembly needs to be dropped.'); + private static readonly descriptionDropConstraintsNotInSource: string = localize('SchemaCompare.Description.DropConstraintsNotInSource', 'Specifies whether constraints that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.'); + private static readonly descriptionDropDmlTriggersNotInSource: string = localize('SchemaCompare.Description.DropDmlTriggersNotInSource', 'Specifies whether DML triggers that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.'); + private static readonly descriptionDropExtendedPropertiesNotInSource: string = localize('SchemaCompare.Description.DropExtendedPropertiesNotInSource', 'Specifies whether extended properties that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.'); + private static readonly descriptionDropIndexesNotInSource: string = localize('SchemaCompare.Description.DropIndexesNotInSource', 'Specifies whether indexes that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.'); + private static readonly descriptionIgnoreFileAndLogFilePath: string = localize('SchemaCompare.Description.IgnoreFileAndLogFilePath', 'Specifies whether differences in the paths for files and log files should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreExtendedProperties: string = localize('SchemaCompare.Description.IgnoreExtendedProperties', 'Specifies whether extended properties should be ignored.'); + private static readonly descriptionIgnoreDmlTriggerState: string = localize('SchemaCompare.Description.IgnoreDmlTriggerState', 'Specifies whether differences in the enabled or disabled state of DML triggers should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreDmlTriggerOrder: string = localize('SchemaCompare.Description.IgnoreDmlTriggerOrder', 'Specifies whether differences in the order of Data Manipulation Language (DML) triggers should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreDefaultSchema: string = localize('SchemaCompare.Description.IgnoreDefaultSchema', 'Specifies whether differences in the default schema should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreDdlTriggerState: string = localize('SchemaCompare.Description.IgnoreDdlTriggerState', 'Specifies whether differences in the enabled or disabled state of Data Definition Language (DDL) triggers should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreDdlTriggerOrder: string = localize('SchemaCompare.Description.IgnoreDdlTriggerOrder', 'Specifies whether differences in the order of Data Definition Language (DDL) triggers should be ignored or updated when you publish to a database or server.'); + private static readonly descriptionIgnoreCryptographicProviderFilePath: string = localize('SchemaCompare.Description.IgnoreCryptographicProviderFilePath', 'Specifies whether differences in the file path for the cryptographic provider should be ignored or updated when you publish to a database.'); + private static readonly descriptionVerifyDeployment: string = localize('SchemaCompare.Description.VerifyDeployment', 'Specifies whether checks should be performed before publishing that will stop the publish action if issues are present that might block successful publishing. For example, your publish action might stop if you have foreign keys on the target database that do not exist in the database project, and that will cause errors when you publish.'); + private static readonly descriptionIgnoreComments: string = localize('SchemaCompare.Description.IgnoreComments', 'Specifies whether differences in the comments should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreColumnCollation: string = localize('SchemaCompare.Description.IgnoreColumnCollation', 'Specifies whether differences in the column collations should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreAuthorizer: string = localize('SchemaCompare.Description.IgnoreAuthorizer', 'Specifies whether differences in the Authorizer should be ignored or updated when you publish to a database.'); + private static readonly descriptionIgnoreAnsiNulls: string = localize('SchemaCompare.Description.IgnoreAnsiNulls', 'Specifies whether differences in the ANSI NULLS setting should be ignored or updated when you publish to a database.'); + private static readonly descriptionGenerateSmartDefaults: string = localize('SchemaCompare.Description.GenerateSmartDefaults', 'Automatically provides a default value when updating a table that contains data with a column that does not allow null values.'); + private static readonly descriptionDropStatisticsNotInSource: string = localize('SchemaCompare.Description.DropStatisticsNotInSource', 'Specifies whether statistics that do not exist in the database snapshot (.dacpac) file will be dropped from the target database when you publish to a database.'); + private static readonly descriptionDropRoleMembersNotInSource: string = localize('SchemaCompare.Description.DropRoleMembersNotInSource', 'Specifies whether role members that are not defined in the database snapshot (.dacpac) file will be dropped from the target database when you publish updates to a database. await this.execute()); + + this.dialog.cancelButton.label = SchemaCompareOptionsDialog.CancelButtonText; + this.dialog.cancelButton.onClick(async () => await this.cancel()); + + azdata.window.openDialog(this.dialog); + } + + protected async execute() { + this.SetDeploymentOptions(); + this.SetObjectTypeOptions(); + } + + protected async cancel() { + } + + private async initializeSchemaCompareOptionsDialogTab() { + this.generalOptionsTab.registerContent(async view => { + + this.optionsFlexBuilder = view.modelBuilder.flexContainer() + .withLayout({ + flexFlow: 'column', + height: 760, + }).component(); + + this.descriptionHeading = view.modelBuilder.table().withProperties({ + columns: [ + { + value: 'Option Description', + headerCssClass: 'no-borders', + toolTip: 'Option Description' + }, + ], + height: 30 + }).component(); + + this.descriptionText = view.modelBuilder.text().withProperties({ + value: ' ', + height: 100 + }).component(); + + this.GetGeneralOptionCheckBoxes(view); + this.generaloptionsCheckBoxes.forEach(box => { + this.optionsFlexBuilder.addItem(box); + }); + + let uberOptionsFlexBuilder = view.modelBuilder.flexContainer() + .withLayout({ + flexFlow: 'column', + }).component(); + + uberOptionsFlexBuilder.addItem(this.optionsFlexBuilder, { CSSStyles: { 'overflow': 'scroll' } }); + uberOptionsFlexBuilder.addItem(this.descriptionHeading, { CSSStyles: { 'font-weight': 'bold' } }); + uberOptionsFlexBuilder.addItem(this.descriptionText, { CSSStyles: { 'padding': '4px' } }); + await view.initializeModel(uberOptionsFlexBuilder); + }); + } + + private async initializeSchemaCompareObjectTypesDialogTab() { + this.objectTypesTab.registerContent(async view => { + + this.objectTypesFlexBuilder = view.modelBuilder.flexContainer() + .withLayout({ + flexFlow: 'column', + height: 900 + }).component(); + + this.GetObjectTypesCheckBoxes(view); + this.objectTypesCheckBoxes.forEach(b => { + this.objectTypesFlexBuilder.addItem(b); + }); + + let uberOptionsFlexBuilder = view.modelBuilder.flexContainer() + .withLayout({ + flexFlow: 'column', + }).component(); + + uberOptionsFlexBuilder.addItem(this.objectTypesFlexBuilder, { CSSStyles: { 'overflow': 'scroll' } }); + + await view.initializeModel(uberOptionsFlexBuilder); + }); + } + + private GetGeneralOptionCheckBoxes(view: azdata.ModelView) { + this.optionsLabels.forEach(l => { + let box: azdata.CheckBoxComponent = view.modelBuilder.checkBox().withProperties({ + checked: this.GetSchemaCompareOptionUtil(l), + label: l, + }).component(); + + box.onChanged(() => { + this.descriptionText.updateProperties({ + value: this.GetDescription(box.label) + }); + }); + this.generaloptionsCheckBoxes.push(box); + }); + } + + private GetObjectTypesCheckBoxes(view: azdata.ModelView) { + this.objectTypeLabels.forEach(l => { + let box: azdata.CheckBoxComponent = view.modelBuilder.checkBox().withProperties({ + checked: this.GetSchemaCompareIncludedObjectsUtil(l), + label: l + }).component(); + this.objectTypesCheckBoxes.push(box); + }); + } + + private SetDeploymentOptions() { + this.generaloptionsCheckBoxes.forEach(box => { + this.SetSchemaCompareOptionUtil(box.label, box.checked); + }); + } + + private SetSchemaCompareOptionUtil(label: string, value: boolean) { + switch (label) { + case SchemaCompareOptionsDialog.IgnoreTableOptions: + this.deploymentOptions.ignoreTableOptions = value; + break; + case SchemaCompareOptionsDialog.IgnoreSemicolonBetweenStatements: + this.deploymentOptions.ignoreSemicolonBetweenStatements = value; + break; + case SchemaCompareOptionsDialog.IgnoreRouteLifetime: + this.deploymentOptions.ignoreRouteLifetime = value; + break; + case SchemaCompareOptionsDialog.IgnoreRoleMembership: + this.deploymentOptions.ignoreRoleMembership = value; + break; + case SchemaCompareOptionsDialog.IgnoreQuotedIdentifiers: + this.deploymentOptions.ignoreQuotedIdentifiers = value; + break; + case SchemaCompareOptionsDialog.IgnorePermissions: + this.deploymentOptions.ignorePermissions = value; + break; + case SchemaCompareOptionsDialog.IgnorePartitionSchemes: + this.deploymentOptions.ignorePartitionSchemes = value; + break; + case SchemaCompareOptionsDialog.IgnoreObjectPlacementOnPartitionScheme: + this.deploymentOptions.ignoreObjectPlacementOnPartitionScheme = value; + break; + case SchemaCompareOptionsDialog.IgnoreNotForReplication: + this.deploymentOptions.ignoreNotForReplication = value; + break; + case SchemaCompareOptionsDialog.IgnoreLoginSids: + this.deploymentOptions.ignoreLoginSids = value; + break; + case SchemaCompareOptionsDialog.IgnoreLockHintsOnIndexes: + this.deploymentOptions.ignoreLockHintsOnIndexes = value; + break; + case SchemaCompareOptionsDialog.IgnoreKeywordCasing: + this.deploymentOptions.ignoreKeywordCasing = value; + break; + case SchemaCompareOptionsDialog.IgnoreIndexPadding: + this.deploymentOptions.ignoreIndexPadding = value; + break; + case SchemaCompareOptionsDialog.IgnoreIndexOptions: + this.deploymentOptions.ignoreIndexOptions = value; + break; + case SchemaCompareOptionsDialog.IgnoreIncrement: + this.deploymentOptions.ignoreIncrement = value; + break; + case SchemaCompareOptionsDialog.IgnoreIdentitySeed: + this.deploymentOptions.ignoreIdentitySeed = value; + break; + case SchemaCompareOptionsDialog.IgnoreUserSettingsObjects: + this.deploymentOptions.ignoreUserSettingsObjects = value; + break; + case SchemaCompareOptionsDialog.IgnoreFullTextCatalogFilePath: + this.deploymentOptions.ignoreFullTextCatalogFilePath = value; + break; + case SchemaCompareOptionsDialog.IgnoreWhitespace: + this.deploymentOptions.ignoreWhitespace = value; + break; + case SchemaCompareOptionsDialog.IgnoreWithNocheckOnForeignKeys: + this.deploymentOptions.ignoreWithNocheckOnForeignKeys = value; + break; + case SchemaCompareOptionsDialog.VerifyCollationCompatibility: + this.deploymentOptions.verifyCollationCompatibility = value; + break; + case SchemaCompareOptionsDialog.UnmodifiableObjectWarnings: + this.deploymentOptions.unmodifiableObjectWarnings = value; + break; + case SchemaCompareOptionsDialog.TreatVerificationErrorsAsWarnings: + this.deploymentOptions.treatVerificationErrorsAsWarnings = value; + break; + case SchemaCompareOptionsDialog.ScriptRefreshModule: + this.deploymentOptions.scriptRefreshModule = value; + break; + case SchemaCompareOptionsDialog.ScriptNewConstraintValidation: + this.deploymentOptions.scriptNewConstraintValidation = value; + break; + case SchemaCompareOptionsDialog.ScriptFileSize: + this.deploymentOptions.scriptFileSize = value; + break; + case SchemaCompareOptionsDialog.ScriptDeployStateChecks: + this.deploymentOptions.scriptDeployStateChecks = value; + break; + case SchemaCompareOptionsDialog.ScriptDatabaseOptions: + this.deploymentOptions.scriptDatabaseOptions = value; + break; + case SchemaCompareOptionsDialog.ScriptDatabaseCompatibility: + this.deploymentOptions.scriptDatabaseCompatibility = value; + break; + case SchemaCompareOptionsDialog.ScriptDatabaseCollation: + this.deploymentOptions.scriptDatabaseCollation = value; + break; + case SchemaCompareOptionsDialog.RunDeploymentPlanExecutors: + this.deploymentOptions.runDeploymentPlanExecutors = value; + break; + case SchemaCompareOptionsDialog.RegisterDataTierApplication: + this.deploymentOptions.registerDataTierApplication = value; + break; + case SchemaCompareOptionsDialog.PopulateFilesOnFileGroups: + this.deploymentOptions.populateFilesOnFileGroups = value; + break; + case SchemaCompareOptionsDialog.NoAlterStatementsToChangeClrTypes: + this.deploymentOptions.noAlterStatementsToChangeClrTypes = value; + break; + case SchemaCompareOptionsDialog.IncludeTransactionalScripts: + this.deploymentOptions.includeTransactionalScripts = value; + break; + case SchemaCompareOptionsDialog.IncludeCompositeObjects: + this.deploymentOptions.includeCompositeObjects = value; + break; + case SchemaCompareOptionsDialog.AllowUnsafeRowLevelSecurityDataMovement: + this.deploymentOptions.allowUnsafeRowLevelSecurityDataMovement = value; + break; + case SchemaCompareOptionsDialog.IgnoreWithNocheckOnCheckConstraints: + this.deploymentOptions.ignoreWithNocheckOnCheckConstraints = value; + break; + case SchemaCompareOptionsDialog.IgnoreFillFactor: + this.deploymentOptions.ignoreFillFactor = value; + break; + case SchemaCompareOptionsDialog.IgnoreFileSize: + this.deploymentOptions.ignoreFileSize = value; + break; + case SchemaCompareOptionsDialog.IgnoreFilegroupPlacement: + this.deploymentOptions.ignoreFilegroupPlacement = value; + break; + case SchemaCompareOptionsDialog.DoNotAlterReplicatedObjects: + this.deploymentOptions.doNotAlterReplicatedObjects = value; + break; + case SchemaCompareOptionsDialog.DoNotAlterChangeDataCaptureObjects: + this.deploymentOptions.doNotAlterChangeDataCaptureObjects = value; + break; + case SchemaCompareOptionsDialog.DisableAndReenableDdlTriggers: + this.deploymentOptions.disableAndReenableDdlTriggers = value; + break; + case SchemaCompareOptionsDialog.DeployDatabaseInSingleUserMode: + this.deploymentOptions.deployDatabaseInSingleUserMode = value; + break; + case SchemaCompareOptionsDialog.CreateNewDatabase: + this.deploymentOptions.createNewDatabase = value; + break; + case SchemaCompareOptionsDialog.CompareUsingTargetCollation: + this.deploymentOptions.compareUsingTargetCollation = value; + break; + case SchemaCompareOptionsDialog.CommentOutSetVarDeclarations: + this.deploymentOptions.commentOutSetVarDeclarations = value; + break; + case SchemaCompareOptionsDialog.BlockWhenDriftDetected: + this.deploymentOptions.blockWhenDriftDetected = value; + break; + case SchemaCompareOptionsDialog.BlockOnPossibleDataLoss: + this.deploymentOptions.blockOnPossibleDataLoss = value; + break; + case SchemaCompareOptionsDialog.BackupDatabaseBeforeChanges: + this.deploymentOptions.backupDatabaseBeforeChanges = value; + break; + case SchemaCompareOptionsDialog.AllowIncompatiblePlatform: + this.deploymentOptions.allowIncompatiblePlatform = value; + break; + case SchemaCompareOptionsDialog.AllowDropBlockingAssemblies: + this.deploymentOptions.allowDropBlockingAssemblies = value; + break; + case SchemaCompareOptionsDialog.DropConstraintsNotInSource: + this.deploymentOptions.dropConstraintsNotInSource = value; + break; + case SchemaCompareOptionsDialog.DropDmlTriggersNotInSource: + this.deploymentOptions.dropDmlTriggersNotInSource = value; + break; + case SchemaCompareOptionsDialog.DropExtendedPropertiesNotInSource: + this.deploymentOptions.dropExtendedPropertiesNotInSource = value; + break; + case SchemaCompareOptionsDialog.DropIndexesNotInSource: + this.deploymentOptions.dropIndexesNotInSource = value; + break; + case SchemaCompareOptionsDialog.IgnoreFileAndLogFilePath: + this.deploymentOptions.ignoreFileAndLogFilePath = value; + break; + case SchemaCompareOptionsDialog.IgnoreExtendedProperties: + this.deploymentOptions.ignoreExtendedProperties = value; + break; + case SchemaCompareOptionsDialog.IgnoreDmlTriggerState: + this.deploymentOptions.ignoreDmlTriggerState = value; + break; + case SchemaCompareOptionsDialog.IgnoreDmlTriggerOrder: + this.deploymentOptions.ignoreDmlTriggerOrder = value; + break; + case SchemaCompareOptionsDialog.IgnoreDefaultSchema: + this.deploymentOptions.ignoreDefaultSchema = value; + break; + case SchemaCompareOptionsDialog.IgnoreDdlTriggerState: + this.deploymentOptions.ignoreDdlTriggerState = value; + break; + case SchemaCompareOptionsDialog.IgnoreDdlTriggerOrder: + this.deploymentOptions.ignoreDdlTriggerOrder = value; + break; + case SchemaCompareOptionsDialog.IgnoreCryptographicProviderFilePath: + this.deploymentOptions.ignoreCryptographicProviderFilePath = value; + break; + case SchemaCompareOptionsDialog.VerifyDeployment: + this.deploymentOptions.verifyDeployment = value; + break; + case SchemaCompareOptionsDialog.IgnoreComments: + this.deploymentOptions.ignoreComments = value; + break; + case SchemaCompareOptionsDialog.IgnoreColumnCollation: + this.deploymentOptions.ignoreColumnCollation = value; + break; + case SchemaCompareOptionsDialog.IgnoreAuthorizer: + this.deploymentOptions.ignoreAuthorizer = value; + break; + case SchemaCompareOptionsDialog.IgnoreAnsiNulls: + this.deploymentOptions.ignoreAnsiNulls = value; + break; + case SchemaCompareOptionsDialog.GenerateSmartDefaults: + this.deploymentOptions.generateSmartDefaults = value; + break; + case SchemaCompareOptionsDialog.DropStatisticsNotInSource: + this.deploymentOptions.dropStatisticsNotInSource = value; + break; + case SchemaCompareOptionsDialog.DropRoleMembersNotInSource: + this.deploymentOptions.dropRoleMembersNotInSource = value; + break; + case SchemaCompareOptionsDialog.DropPermissionsNotInSource: + this.deploymentOptions.dropPermissionsNotInSource = value; + break; + case SchemaCompareOptionsDialog.DropObjectsNotInSource: + this.deploymentOptions.dropObjectsNotInSource = value; + break; + case SchemaCompareOptionsDialog.IgnoreColumnOrder: + this.deploymentOptions.ignoreColumnOrder = value; + break; + } + } + + private GetSchemaCompareOptionUtil(label): boolean { + switch (label) { + case SchemaCompareOptionsDialog.IgnoreTableOptions: + return this.deploymentOptions.ignoreTableOptions; + + case SchemaCompareOptionsDialog.IgnoreSemicolonBetweenStatements: + return this.deploymentOptions.ignoreSemicolonBetweenStatements; + + case SchemaCompareOptionsDialog.IgnoreRouteLifetime: + return this.deploymentOptions.ignoreRouteLifetime; + + case SchemaCompareOptionsDialog.IgnoreRoleMembership: + return this.deploymentOptions.ignoreRoleMembership; + + case SchemaCompareOptionsDialog.IgnoreQuotedIdentifiers: + return this.deploymentOptions.ignoreQuotedIdentifiers; + + case SchemaCompareOptionsDialog.IgnorePermissions: + return this.deploymentOptions.ignorePermissions; + + case SchemaCompareOptionsDialog.IgnorePartitionSchemes: + return this.deploymentOptions.ignorePartitionSchemes; + + case SchemaCompareOptionsDialog.IgnoreObjectPlacementOnPartitionScheme: + return this.deploymentOptions.ignoreObjectPlacementOnPartitionScheme; + + case SchemaCompareOptionsDialog.IgnoreNotForReplication: + return this.deploymentOptions.ignoreNotForReplication; + + case SchemaCompareOptionsDialog.IgnoreLoginSids: + return this.deploymentOptions.ignoreLoginSids; + + case SchemaCompareOptionsDialog.IgnoreLockHintsOnIndexes: + return this.deploymentOptions.ignoreLockHintsOnIndexes; + + case SchemaCompareOptionsDialog.IgnoreKeywordCasing: + return this.deploymentOptions.ignoreKeywordCasing; + + case SchemaCompareOptionsDialog.IgnoreIndexPadding: + return this.deploymentOptions.ignoreIndexPadding; + + case SchemaCompareOptionsDialog.IgnoreIndexOptions: + return this.deploymentOptions.ignoreIndexOptions; + + case SchemaCompareOptionsDialog.IgnoreIncrement: + return this.deploymentOptions.ignoreIncrement; + + case SchemaCompareOptionsDialog.IgnoreIdentitySeed: + return this.deploymentOptions.ignoreIdentitySeed; + + case SchemaCompareOptionsDialog.IgnoreUserSettingsObjects: + return this.deploymentOptions.ignoreUserSettingsObjects; + + case SchemaCompareOptionsDialog.IgnoreFullTextCatalogFilePath: + return this.deploymentOptions.ignoreFullTextCatalogFilePath; + + case SchemaCompareOptionsDialog.IgnoreWhitespace: + return this.deploymentOptions.ignoreWhitespace; + + case SchemaCompareOptionsDialog.IgnoreWithNocheckOnForeignKeys: + return this.deploymentOptions.ignoreWithNocheckOnForeignKeys; + + case SchemaCompareOptionsDialog.VerifyCollationCompatibility: + return this.deploymentOptions.verifyCollationCompatibility; + + case SchemaCompareOptionsDialog.UnmodifiableObjectWarnings: + return this.deploymentOptions.unmodifiableObjectWarnings; + + case SchemaCompareOptionsDialog.TreatVerificationErrorsAsWarnings: + return this.deploymentOptions.treatVerificationErrorsAsWarnings; + + case SchemaCompareOptionsDialog.ScriptRefreshModule: + return this.deploymentOptions.scriptRefreshModule; + + case SchemaCompareOptionsDialog.ScriptNewConstraintValidation: + return this.deploymentOptions.scriptNewConstraintValidation; + + case SchemaCompareOptionsDialog.ScriptFileSize: + return this.deploymentOptions.scriptFileSize; + + case SchemaCompareOptionsDialog.ScriptDeployStateChecks: + return this.deploymentOptions.scriptDeployStateChecks; + + case SchemaCompareOptionsDialog.ScriptDatabaseOptions: + return this.deploymentOptions.scriptDatabaseOptions; + + case SchemaCompareOptionsDialog.ScriptDatabaseCompatibility: + return this.deploymentOptions.scriptDatabaseCompatibility; + + case SchemaCompareOptionsDialog.ScriptDatabaseCollation: + return this.deploymentOptions.scriptDatabaseCollation; + + case SchemaCompareOptionsDialog.RunDeploymentPlanExecutors: + return this.deploymentOptions.runDeploymentPlanExecutors; + + case SchemaCompareOptionsDialog.RegisterDataTierApplication: + return this.deploymentOptions.registerDataTierApplication; + + case SchemaCompareOptionsDialog.PopulateFilesOnFileGroups: + return this.deploymentOptions.populateFilesOnFileGroups; + + case SchemaCompareOptionsDialog.NoAlterStatementsToChangeClrTypes: + return this.deploymentOptions.noAlterStatementsToChangeClrTypes; + + case SchemaCompareOptionsDialog.IncludeTransactionalScripts: + return this.deploymentOptions.includeTransactionalScripts; + + case SchemaCompareOptionsDialog.IncludeCompositeObjects: + return this.deploymentOptions.includeCompositeObjects; + + case SchemaCompareOptionsDialog.AllowUnsafeRowLevelSecurityDataMovement: + return this.deploymentOptions.allowUnsafeRowLevelSecurityDataMovement; + + case SchemaCompareOptionsDialog.IgnoreWithNocheckOnCheckConstraints: + return this.deploymentOptions.ignoreWithNocheckOnCheckConstraints; + + case SchemaCompareOptionsDialog.IgnoreFillFactor: + return this.deploymentOptions.ignoreFillFactor; + + case SchemaCompareOptionsDialog.IgnoreFileSize: + return this.deploymentOptions.ignoreFileSize; + + case SchemaCompareOptionsDialog.IgnoreFilegroupPlacement: + return this.deploymentOptions.ignoreFilegroupPlacement; + + case SchemaCompareOptionsDialog.DoNotAlterReplicatedObjects: + return this.deploymentOptions.doNotAlterReplicatedObjects; + + case SchemaCompareOptionsDialog.DoNotAlterChangeDataCaptureObjects: + return this.deploymentOptions.doNotAlterChangeDataCaptureObjects; + + case SchemaCompareOptionsDialog.DisableAndReenableDdlTriggers: + return this.deploymentOptions.disableAndReenableDdlTriggers; + + case SchemaCompareOptionsDialog.DeployDatabaseInSingleUserMode: + return this.deploymentOptions.deployDatabaseInSingleUserMode; + + case SchemaCompareOptionsDialog.CreateNewDatabase: + return this.deploymentOptions.createNewDatabase; + + case SchemaCompareOptionsDialog.CompareUsingTargetCollation: + return this.deploymentOptions.compareUsingTargetCollation; + + case SchemaCompareOptionsDialog.CommentOutSetVarDeclarations: + return this.deploymentOptions.commentOutSetVarDeclarations; + + case SchemaCompareOptionsDialog.BlockWhenDriftDetected: + return this.deploymentOptions.blockWhenDriftDetected; + + case SchemaCompareOptionsDialog.BlockOnPossibleDataLoss: + return this.deploymentOptions.blockOnPossibleDataLoss; + + case SchemaCompareOptionsDialog.BackupDatabaseBeforeChanges: + return this.deploymentOptions.backupDatabaseBeforeChanges; + + case SchemaCompareOptionsDialog.AllowIncompatiblePlatform: + return this.deploymentOptions.allowIncompatiblePlatform; + + case SchemaCompareOptionsDialog.AllowDropBlockingAssemblies: + return this.deploymentOptions.allowDropBlockingAssemblies; + + case SchemaCompareOptionsDialog.DropConstraintsNotInSource: + return this.deploymentOptions.dropConstraintsNotInSource; + + case SchemaCompareOptionsDialog.DropDmlTriggersNotInSource: + return this.deploymentOptions.dropDmlTriggersNotInSource; + + case SchemaCompareOptionsDialog.DropExtendedPropertiesNotInSource: + return this.deploymentOptions.dropExtendedPropertiesNotInSource; + + case SchemaCompareOptionsDialog.DropIndexesNotInSource: + return this.deploymentOptions.dropIndexesNotInSource; + + case SchemaCompareOptionsDialog.IgnoreFileAndLogFilePath: + return this.deploymentOptions.ignoreFileAndLogFilePath; + + case SchemaCompareOptionsDialog.IgnoreExtendedProperties: + return this.deploymentOptions.ignoreExtendedProperties; + + case SchemaCompareOptionsDialog.IgnoreDmlTriggerState: + return this.deploymentOptions.ignoreDmlTriggerState; + + case SchemaCompareOptionsDialog.IgnoreDmlTriggerOrder: + return this.deploymentOptions.ignoreDmlTriggerOrder; + + case SchemaCompareOptionsDialog.IgnoreDefaultSchema: + return this.deploymentOptions.ignoreDefaultSchema; + + case SchemaCompareOptionsDialog.IgnoreDdlTriggerState: + return this.deploymentOptions.ignoreDdlTriggerState; + + case SchemaCompareOptionsDialog.IgnoreDdlTriggerOrder: + return this.deploymentOptions.ignoreDdlTriggerOrder; + + case SchemaCompareOptionsDialog.IgnoreCryptographicProviderFilePath: + return this.deploymentOptions.ignoreCryptographicProviderFilePath; + + case SchemaCompareOptionsDialog.VerifyDeployment: + return this.deploymentOptions.verifyDeployment; + + case SchemaCompareOptionsDialog.IgnoreComments: + return this.deploymentOptions.ignoreComments; + + case SchemaCompareOptionsDialog.IgnoreColumnCollation: + return this.deploymentOptions.ignoreColumnCollation; + + case SchemaCompareOptionsDialog.IgnoreAuthorizer: + return this.deploymentOptions.ignoreAuthorizer; + + case SchemaCompareOptionsDialog.IgnoreAnsiNulls: + return this.deploymentOptions.ignoreAnsiNulls; + + case SchemaCompareOptionsDialog.GenerateSmartDefaults: + return this.deploymentOptions.generateSmartDefaults; + + case SchemaCompareOptionsDialog.DropStatisticsNotInSource: + return this.deploymentOptions.dropStatisticsNotInSource; + + case SchemaCompareOptionsDialog.DropRoleMembersNotInSource: + return this.deploymentOptions.dropRoleMembersNotInSource; + + case SchemaCompareOptionsDialog.DropPermissionsNotInSource: + return this.deploymentOptions.dropPermissionsNotInSource; + + case SchemaCompareOptionsDialog.DropObjectsNotInSource: + return this.deploymentOptions.dropObjectsNotInSource; + + case SchemaCompareOptionsDialog.IgnoreColumnOrder: + return this.deploymentOptions.ignoreColumnOrder; + } + return false; + } + + private SetObjectTypeOptions() { + this.objectTypesCheckBoxes.forEach(box => { + this.SetSchemaCompareIncludedObjectsUtil(box.label, box.checked); + }); + this.deploymentOptions.excludeObjectTypes = this.excludedObjectTypes; + } + + private GetSchemaCompareIncludedObjectsUtil(label): boolean { + switch (label) { + case SchemaCompareOptionsDialog.Aggregates: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.aggregates)) ? false : true; + case SchemaCompareOptionsDialog.ApplicationRoles: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.applicationRoles)) ? false : true; + case SchemaCompareOptionsDialog.Assemblies: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.assemblies)) ? false : true; + case SchemaCompareOptionsDialog.AssemblyFiles: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.assemblyFiles)) ? false : true; + case SchemaCompareOptionsDialog.AsymmetricKeys: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.asymmetricKeys)) ? false : true; + case SchemaCompareOptionsDialog.BrokerPriorities: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.brokerPriorities)) ? false : true; + case SchemaCompareOptionsDialog.Certificates: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.certificates)) ? false : true; + case SchemaCompareOptionsDialog.ColumnEncryptionKeys: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.columnEncryptionKeys)) ? false : true; + case SchemaCompareOptionsDialog.ColumnMasterKeys: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.columnMasterKeys)) ? false : true; + case SchemaCompareOptionsDialog.Contracts: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.contracts)) ? false : true; + case SchemaCompareOptionsDialog.DatabaseOptions: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.databaseOptions)) ? false : true; + case SchemaCompareOptionsDialog.DatabaseRoles: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.databaseRoles)) ? false : true; + case SchemaCompareOptionsDialog.DatabaseTriggers: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.databaseTriggers)) ? false : true; + case SchemaCompareOptionsDialog.Defaults: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.defaults)) ? false : true; + case SchemaCompareOptionsDialog.ExtendedProperties: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.extendedProperties)) ? false : true; + case SchemaCompareOptionsDialog.ExternalDataSources: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.externalDataSources)) ? false : true; + case SchemaCompareOptionsDialog.ExternalFileFormats: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.externalFileFormats)) ? false : true; + case SchemaCompareOptionsDialog.ExternalTables: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.externalTables)) ? false : true; + case SchemaCompareOptionsDialog.Filegroups: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.filegroups)) ? false : true; + case SchemaCompareOptionsDialog.FileTables: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.fileTables)) ? false : true; + case SchemaCompareOptionsDialog.FullTextCatalogs: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.fullTextCatalogs)) ? false : true; + case SchemaCompareOptionsDialog.FullTextStoplists: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.fullTextStoplists)) ? false : true; + case SchemaCompareOptionsDialog.MessageTypes: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.messageTypes)) ? false : true; + case SchemaCompareOptionsDialog.PartitionFunctions: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.partitionFunctions)) ? false : true; + case SchemaCompareOptionsDialog.PartitionSchemes: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.partitionSchemes)) ? false : true; + case SchemaCompareOptionsDialog.Permissions: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.permissions)) ? false : true; + case SchemaCompareOptionsDialog.Queues: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.queues)) ? false : true; + case SchemaCompareOptionsDialog.RemoteServiceBindings: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.remoteServiceBindings)) ? false : true; + case SchemaCompareOptionsDialog.RoleMembership: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.roleMembership)) ? false : true; + case SchemaCompareOptionsDialog.Rules: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.rules)) ? false : true; + case SchemaCompareOptionsDialog.ScalarValuedFunctions: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.scalarValuedFunctions)) ? false : true; + case SchemaCompareOptionsDialog.SearchPropertyLists: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.searchPropertyLists)) ? false : true; + case SchemaCompareOptionsDialog.SecurityPolicies: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.securityPolicies)) ? false : true; + case SchemaCompareOptionsDialog.Sequences: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.sequences)) ? false : true; + case SchemaCompareOptionsDialog.Services: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.services)) ? false : true; + case SchemaCompareOptionsDialog.Signatures: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.signatures)) ? false : true; + case SchemaCompareOptionsDialog.StoredProcedures: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.storedProcedures)) ? false : true; + case SchemaCompareOptionsDialog.SymmetricKeys: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.symmetricKeys)) ? false : true; + case SchemaCompareOptionsDialog.Synonyms: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.synonyms)) ? false : true; + case SchemaCompareOptionsDialog.Tables: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.tables)) ? false : true; + case SchemaCompareOptionsDialog.TableValuedFunctions: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.tableValuedFunctions)) ? false : true; + case SchemaCompareOptionsDialog.UserDefinedDataTypes: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.userDefinedDataTypes)) ? false : true; + case SchemaCompareOptionsDialog.UserDefinedTableTypes: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.userDefinedTableTypes)) ? false : true; + case SchemaCompareOptionsDialog.ClrUserDefinedTypes: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.clrUserDefinedTypes)) ? false : true; + case SchemaCompareOptionsDialog.Users: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.users)) ? false : true; + case SchemaCompareOptionsDialog.Views: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.views)) ? false : true; + case SchemaCompareOptionsDialog.XmlSchemaCollections: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.xmlSchemaCollections)) ? false : true; + case SchemaCompareOptionsDialog.Audits: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.audits)) ? false : true; + case SchemaCompareOptionsDialog.Credentials: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.credentials)) ? false : true; + case SchemaCompareOptionsDialog.CryptographicProviders: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.cryptographicProviders)) ? false : true; + case SchemaCompareOptionsDialog.DatabaseAuditSpecifications: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.databaseAuditSpecifications)) ? false : true; + case SchemaCompareOptionsDialog.DatabaseEncryptionKeys: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.databaseEncryptionKeys)) ? false : true; + case SchemaCompareOptionsDialog.DatabaseScopedCredentials: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.databaseScopedCredentials)) ? false : true; + case SchemaCompareOptionsDialog.Endpoints: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.endpoints)) ? false : true; + case SchemaCompareOptionsDialog.ErrorMessages: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.errorMessages)) ? false : true; + case SchemaCompareOptionsDialog.EventNotifications: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.eventNotifications)) ? false : true; + case SchemaCompareOptionsDialog.EventSessions: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.eventSessions)) ? false : true; + case SchemaCompareOptionsDialog.LinkedServerLogins: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.linkedServerLogins)) ? false : true; + case SchemaCompareOptionsDialog.LinkedServers: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.linkedServers)) ? false : true; + case SchemaCompareOptionsDialog.Logins: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.logins)) ? false : true; + case SchemaCompareOptionsDialog.MasterKeys: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.masterKeys)) ? false : true; + case SchemaCompareOptionsDialog.Routes: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.routes)) ? false : true; + case SchemaCompareOptionsDialog.ServerAuditSpecifications: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.serverAuditSpecifications)) ? false : true; + case SchemaCompareOptionsDialog.ServerRoleMembership: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.serverRoleMembership)) ? false : true; + case SchemaCompareOptionsDialog.ServerRoles: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.serverRoles)) ? false : true; + case SchemaCompareOptionsDialog.ServerTriggers: + return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.serverTriggers)) ? false : true; + } + return false; + } + + private SetSchemaCompareIncludedObjectsUtil(label: string, included: boolean) { + switch (label) { + case SchemaCompareOptionsDialog.Aggregates: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.aggregates); + } + return; + case SchemaCompareOptionsDialog.ApplicationRoles: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.applicationRoles); + } + return; + case SchemaCompareOptionsDialog.Assemblies: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.assemblies); + } + return; + case SchemaCompareOptionsDialog.AssemblyFiles: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.assemblyFiles); + } + return; + case SchemaCompareOptionsDialog.AsymmetricKeys: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.asymmetricKeys); + } + return; + case SchemaCompareOptionsDialog.BrokerPriorities: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.brokerPriorities); + } + return; + case SchemaCompareOptionsDialog.Certificates: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.certificates); + } + return; + case SchemaCompareOptionsDialog.ColumnEncryptionKeys: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.columnEncryptionKeys); + } + return; + case SchemaCompareOptionsDialog.ColumnMasterKeys: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.columnMasterKeys); + } + return; + case SchemaCompareOptionsDialog.Contracts: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.contracts); + } + return; + case SchemaCompareOptionsDialog.DatabaseOptions: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.databaseOptions); + } + return; + case SchemaCompareOptionsDialog.DatabaseRoles: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.databaseRoles); + } + return; + case SchemaCompareOptionsDialog.DatabaseTriggers: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.databaseTriggers); + } + return; + case SchemaCompareOptionsDialog.Defaults: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.defaults); + } + return; + case SchemaCompareOptionsDialog.ExtendedProperties: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.extendedProperties); + } + return; + case SchemaCompareOptionsDialog.ExternalDataSources: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.externalDataSources); + } + return; + case SchemaCompareOptionsDialog.ExternalFileFormats: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.externalFileFormats); + } + return; + case SchemaCompareOptionsDialog.ExternalTables: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.externalTables); + } + return; + case SchemaCompareOptionsDialog.Filegroups: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.filegroups); + } + return; + case SchemaCompareOptionsDialog.FileTables: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.fileTables); + } + return; + case SchemaCompareOptionsDialog.FullTextCatalogs: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.fullTextCatalogs); + } + return; + case SchemaCompareOptionsDialog.FullTextStoplists: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.fullTextStoplists); + } + return; + case SchemaCompareOptionsDialog.MessageTypes: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.messageTypes); + } + return; + case SchemaCompareOptionsDialog.PartitionFunctions: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.partitionFunctions); + } + return; + case SchemaCompareOptionsDialog.PartitionSchemes: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.partitionSchemes); + } + return; + case SchemaCompareOptionsDialog.Permissions: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.permissions); + } + return; + case SchemaCompareOptionsDialog.Queues: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.queues); + } + return; + case SchemaCompareOptionsDialog.RemoteServiceBindings: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.remoteServiceBindings); + } + return; + case SchemaCompareOptionsDialog.RoleMembership: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.roleMembership); + } + return; + case SchemaCompareOptionsDialog.Rules: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.rules); + } + return; + case SchemaCompareOptionsDialog.ScalarValuedFunctions: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.scalarValuedFunctions); + } + return; + case SchemaCompareOptionsDialog.SearchPropertyLists: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.searchPropertyLists); + } + return; + case SchemaCompareOptionsDialog.SecurityPolicies: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.securityPolicies); + } + return; + case SchemaCompareOptionsDialog.Sequences: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.sequences); + } + return; + case SchemaCompareOptionsDialog.Services: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.services); + } + return; + case SchemaCompareOptionsDialog.Signatures: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.signatures); + } + return; + case SchemaCompareOptionsDialog.StoredProcedures: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.storedProcedures); + } + return; + case SchemaCompareOptionsDialog.SymmetricKeys: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.symmetricKeys); + } + return; + case SchemaCompareOptionsDialog.Synonyms: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.synonyms); + } + return; + case SchemaCompareOptionsDialog.Tables: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.tables); + } + return; + case SchemaCompareOptionsDialog.TableValuedFunctions: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.tableValuedFunctions); + } + return; + case SchemaCompareOptionsDialog.UserDefinedDataTypes: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.userDefinedDataTypes); + } + return; + case SchemaCompareOptionsDialog.UserDefinedTableTypes: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.userDefinedTableTypes); + } + return; + case SchemaCompareOptionsDialog.ClrUserDefinedTypes: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.clrUserDefinedTypes); + } + return; + case SchemaCompareOptionsDialog.Users: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.users); + } + return; + case SchemaCompareOptionsDialog.Views: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.views); + } + return; + case SchemaCompareOptionsDialog.XmlSchemaCollections: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.xmlSchemaCollections); + } + return; + case SchemaCompareOptionsDialog.Audits: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.audits); + } + return; + case SchemaCompareOptionsDialog.Credentials: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.credentials); + } + return; + case SchemaCompareOptionsDialog.CryptographicProviders: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.cryptographicProviders); + } + return; + case SchemaCompareOptionsDialog.DatabaseAuditSpecifications: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.databaseAuditSpecifications); + } + return; + case SchemaCompareOptionsDialog.DatabaseEncryptionKeys: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.databaseEncryptionKeys); + } + return; + case SchemaCompareOptionsDialog.DatabaseScopedCredentials: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.databaseScopedCredentials); + } + return; + case SchemaCompareOptionsDialog.Endpoints: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.endpoints); + } + return; + case SchemaCompareOptionsDialog.ErrorMessages: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.errorMessages); + } + return; + case SchemaCompareOptionsDialog.EventNotifications: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.eventNotifications); + } + return; + case SchemaCompareOptionsDialog.EventSessions: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.eventSessions); + } + return; + case SchemaCompareOptionsDialog.LinkedServerLogins: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.linkedServerLogins); + } + return; + case SchemaCompareOptionsDialog.LinkedServers: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.linkedServers); + } + return; + case SchemaCompareOptionsDialog.Logins: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.logins); + } + return; + case SchemaCompareOptionsDialog.MasterKeys: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.masterKeys); + } + return; + case SchemaCompareOptionsDialog.Routes: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.routes); + } + return; + case SchemaCompareOptionsDialog.ServerAuditSpecifications: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.serverAuditSpecifications); + } + return; + case SchemaCompareOptionsDialog.ServerRoleMembership: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.serverRoleMembership); + } + return; + case SchemaCompareOptionsDialog.ServerRoles: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.serverRoles); + } + return; + case SchemaCompareOptionsDialog.ServerTriggers: + if (!included) { + this.excludedObjectTypes.push(azdata.SchemaObjectType.serverTriggers); + } + return; + } + } + + private GetDescription(label: string): string { + switch (label) { + case SchemaCompareOptionsDialog.IgnoreTableOptions: + return SchemaCompareOptionsDialog.descriptionIgnoreTableOptions; + + case SchemaCompareOptionsDialog.IgnoreSemicolonBetweenStatements: + return SchemaCompareOptionsDialog.descriptionIgnoreSemicolonBetweenStatements; + + case SchemaCompareOptionsDialog.IgnoreRouteLifetime: + return SchemaCompareOptionsDialog.descriptionIgnoreRouteLifetime; + + case SchemaCompareOptionsDialog.IgnoreRoleMembership: + return SchemaCompareOptionsDialog.descriptionIgnoreRoleMembership; + + case SchemaCompareOptionsDialog.IgnoreQuotedIdentifiers: + return SchemaCompareOptionsDialog.descriptionIgnoreQuotedIdentifiers; + + case SchemaCompareOptionsDialog.IgnorePermissions: + return SchemaCompareOptionsDialog.descriptionIgnorePermissions; + + case SchemaCompareOptionsDialog.IgnorePartitionSchemes: + return SchemaCompareOptionsDialog.descriptionIgnorePartitionSchemes; + + case SchemaCompareOptionsDialog.IgnoreObjectPlacementOnPartitionScheme: + return SchemaCompareOptionsDialog.descriptionIgnoreObjectPlacementOnPartitionScheme; + + case SchemaCompareOptionsDialog.IgnoreNotForReplication: + return SchemaCompareOptionsDialog.descriptionIgnoreNotForReplication; + + case SchemaCompareOptionsDialog.IgnoreLoginSids: + return SchemaCompareOptionsDialog.descriptionIgnoreLoginSids; + + case SchemaCompareOptionsDialog.IgnoreLockHintsOnIndexes: + return SchemaCompareOptionsDialog.descriptionIgnoreLockHintsOnIndexes; + + case SchemaCompareOptionsDialog.IgnoreKeywordCasing: + return SchemaCompareOptionsDialog.descriptionIgnoreKeywordCasing; + + case SchemaCompareOptionsDialog.IgnoreIndexPadding: + return SchemaCompareOptionsDialog.descriptionIgnoreIndexPadding; + + case SchemaCompareOptionsDialog.IgnoreIndexOptions: + return SchemaCompareOptionsDialog.descriptionIgnoreIndexOptions; + + case SchemaCompareOptionsDialog.IgnoreIncrement: + return SchemaCompareOptionsDialog.descriptionIgnoreIncrement; + + case SchemaCompareOptionsDialog.IgnoreIdentitySeed: + return SchemaCompareOptionsDialog.descriptionIgnoreIdentitySeed; + + case SchemaCompareOptionsDialog.IgnoreUserSettingsObjects: + return SchemaCompareOptionsDialog.descriptionIgnoreUserSettingsObjects; + + case SchemaCompareOptionsDialog.IgnoreFullTextCatalogFilePath: + return SchemaCompareOptionsDialog.descriptionIgnoreFullTextCatalogFilePath; + + case SchemaCompareOptionsDialog.IgnoreWhitespace: + return SchemaCompareOptionsDialog.descriptionIgnoreWhitespace; + + case SchemaCompareOptionsDialog.IgnoreWithNocheckOnForeignKeys: + return SchemaCompareOptionsDialog.descriptionIgnoreWithNocheckOnForeignKeys; + + case SchemaCompareOptionsDialog.VerifyCollationCompatibility: + return SchemaCompareOptionsDialog.descriptionVerifyCollationCompatibility; + + case SchemaCompareOptionsDialog.UnmodifiableObjectWarnings: + return SchemaCompareOptionsDialog.descriptionUnmodifiableObjectWarnings; + + case SchemaCompareOptionsDialog.TreatVerificationErrorsAsWarnings: + return SchemaCompareOptionsDialog.descriptionTreatVerificationErrorsAsWarnings; + + case SchemaCompareOptionsDialog.ScriptRefreshModule: + return SchemaCompareOptionsDialog.descriptionScriptRefreshModule; + + case SchemaCompareOptionsDialog.ScriptNewConstraintValidation: + return SchemaCompareOptionsDialog.descriptionScriptNewConstraintValidation; + + case SchemaCompareOptionsDialog.ScriptFileSize: + return SchemaCompareOptionsDialog.descriptionScriptFileSize; + + case SchemaCompareOptionsDialog.ScriptDeployStateChecks: + return SchemaCompareOptionsDialog.descriptionScriptDeployStateChecks; + + case SchemaCompareOptionsDialog.ScriptDatabaseOptions: + return SchemaCompareOptionsDialog.descriptionScriptDatabaseOptions; + + case SchemaCompareOptionsDialog.ScriptDatabaseCompatibility: + return SchemaCompareOptionsDialog.descriptionScriptDatabaseCompatibility; + + case SchemaCompareOptionsDialog.ScriptDatabaseCollation: + return SchemaCompareOptionsDialog.descriptionScriptDatabaseCollation; + + case SchemaCompareOptionsDialog.RunDeploymentPlanExecutors: + return SchemaCompareOptionsDialog.descriptionRunDeploymentPlanExecutors; + + case SchemaCompareOptionsDialog.RegisterDataTierApplication: + return SchemaCompareOptionsDialog.descriptionRegisterDataTierApplication; + + case SchemaCompareOptionsDialog.PopulateFilesOnFileGroups: + return SchemaCompareOptionsDialog.descriptionPopulateFilesOnFileGroups; + + case SchemaCompareOptionsDialog.NoAlterStatementsToChangeClrTypes: + return SchemaCompareOptionsDialog.descriptionNoAlterStatementsToChangeClrTypes; + + case SchemaCompareOptionsDialog.IncludeTransactionalScripts: + return SchemaCompareOptionsDialog.descriptionIncludeTransactionalScripts; + + case SchemaCompareOptionsDialog.IncludeCompositeObjects: + return SchemaCompareOptionsDialog.descriptionIncludeCompositeObjects; + + case SchemaCompareOptionsDialog.AllowUnsafeRowLevelSecurityDataMovement: + return SchemaCompareOptionsDialog.descriptionAllowUnsafeRowLevelSecurityDataMovement; + + case SchemaCompareOptionsDialog.IgnoreWithNocheckOnCheckConstraints: + return SchemaCompareOptionsDialog.descriptionIgnoreWithNocheckOnCheckConstraints; + + case SchemaCompareOptionsDialog.IgnoreFillFactor: + return SchemaCompareOptionsDialog.descriptionIgnoreFillFactor; + + case SchemaCompareOptionsDialog.IgnoreFileSize: + return SchemaCompareOptionsDialog.descriptionIgnoreFileSize; + + case SchemaCompareOptionsDialog.IgnoreFilegroupPlacement: + return SchemaCompareOptionsDialog.descriptionIgnoreFilegroupPlacement; + + case SchemaCompareOptionsDialog.DoNotAlterReplicatedObjects: + return SchemaCompareOptionsDialog.descriptionDoNotAlterReplicatedObjects; + + case SchemaCompareOptionsDialog.DoNotAlterChangeDataCaptureObjects: + return SchemaCompareOptionsDialog.descriptionDoNotAlterChangeDataCaptureObjects; + + case SchemaCompareOptionsDialog.DisableAndReenableDdlTriggers: + return SchemaCompareOptionsDialog.descriptionDisableAndReenableDdlTriggers; + + case SchemaCompareOptionsDialog.DeployDatabaseInSingleUserMode: + return SchemaCompareOptionsDialog.descriptionDeployDatabaseInSingleUserMode; + + case SchemaCompareOptionsDialog.CreateNewDatabase: + return SchemaCompareOptionsDialog.descriptionCreateNewDatabase; + + case SchemaCompareOptionsDialog.CompareUsingTargetCollation: + return SchemaCompareOptionsDialog.descriptionCompareUsingTargetCollation; + + case SchemaCompareOptionsDialog.CommentOutSetVarDeclarations: + return SchemaCompareOptionsDialog.descriptionCommentOutSetVarDeclarations; + + case SchemaCompareOptionsDialog.BlockWhenDriftDetected: + return SchemaCompareOptionsDialog.descriptionBlockWhenDriftDetected; + + case SchemaCompareOptionsDialog.BlockOnPossibleDataLoss: + return SchemaCompareOptionsDialog.descriptionBlockOnPossibleDataLoss; + + case SchemaCompareOptionsDialog.BackupDatabaseBeforeChanges: + return SchemaCompareOptionsDialog.descriptionBackupDatabaseBeforeChanges; + + case SchemaCompareOptionsDialog.AllowIncompatiblePlatform: + return SchemaCompareOptionsDialog.descriptionAllowIncompatiblePlatform; + + case SchemaCompareOptionsDialog.AllowDropBlockingAssemblies: + return SchemaCompareOptionsDialog.descriptionAllowDropBlockingAssemblies; + + case SchemaCompareOptionsDialog.DropConstraintsNotInSource: + return SchemaCompareOptionsDialog.descriptionDropConstraintsNotInSource; + + case SchemaCompareOptionsDialog.DropDmlTriggersNotInSource: + return SchemaCompareOptionsDialog.descriptionDropDmlTriggersNotInSource; + + case SchemaCompareOptionsDialog.DropExtendedPropertiesNotInSource: + return SchemaCompareOptionsDialog.descriptionDropExtendedPropertiesNotInSource; + + case SchemaCompareOptionsDialog.DropIndexesNotInSource: + return SchemaCompareOptionsDialog.descriptionDropIndexesNotInSource; + + case SchemaCompareOptionsDialog.IgnoreFileAndLogFilePath: + return SchemaCompareOptionsDialog.descriptionIgnoreFileAndLogFilePath; + + case SchemaCompareOptionsDialog.IgnoreExtendedProperties: + return SchemaCompareOptionsDialog.descriptionIgnoreExtendedProperties; + + case SchemaCompareOptionsDialog.IgnoreDmlTriggerState: + return SchemaCompareOptionsDialog.descriptionIgnoreDmlTriggerState; + + case SchemaCompareOptionsDialog.IgnoreDmlTriggerOrder: + return SchemaCompareOptionsDialog.descriptionIgnoreDmlTriggerOrder; + + case SchemaCompareOptionsDialog.IgnoreDefaultSchema: + return SchemaCompareOptionsDialog.descriptionIgnoreDefaultSchema; + + case SchemaCompareOptionsDialog.IgnoreDdlTriggerState: + return SchemaCompareOptionsDialog.descriptionIgnoreDdlTriggerState; + + case SchemaCompareOptionsDialog.IgnoreDdlTriggerOrder: + return SchemaCompareOptionsDialog.descriptionIgnoreDdlTriggerOrder; + + case SchemaCompareOptionsDialog.IgnoreCryptographicProviderFilePath: + return SchemaCompareOptionsDialog.descriptionIgnoreCryptographicProviderFilePath; + + case SchemaCompareOptionsDialog.VerifyDeployment: + return SchemaCompareOptionsDialog.descriptionVerifyDeployment; + + case SchemaCompareOptionsDialog.IgnoreComments: + return SchemaCompareOptionsDialog.descriptionIgnoreComments; + + case SchemaCompareOptionsDialog.IgnoreColumnCollation: + return SchemaCompareOptionsDialog.descriptionIgnoreColumnCollation; + + case SchemaCompareOptionsDialog.IgnoreAuthorizer: + return SchemaCompareOptionsDialog.descriptionIgnoreAuthorizer; + + case SchemaCompareOptionsDialog.IgnoreAnsiNulls: + return SchemaCompareOptionsDialog.descriptionIgnoreAnsiNulls; + + case SchemaCompareOptionsDialog.GenerateSmartDefaults: + return SchemaCompareOptionsDialog.descriptionGenerateSmartDefaults; + + case SchemaCompareOptionsDialog.DropStatisticsNotInSource: + return SchemaCompareOptionsDialog.descriptionDropStatisticsNotInSource; + + case SchemaCompareOptionsDialog.DropRoleMembersNotInSource: + return SchemaCompareOptionsDialog.descriptionDropRoleMembersNotInSource; + + case SchemaCompareOptionsDialog.DropPermissionsNotInSource: + return SchemaCompareOptionsDialog.descriptionDropPermissionsNotInSource; + + case SchemaCompareOptionsDialog.DropObjectsNotInSource: + return SchemaCompareOptionsDialog.descriptionDropObjectsNotInSource; + + case SchemaCompareOptionsDialog.IgnoreColumnOrder: + return SchemaCompareOptionsDialog.descriptionIgnoreColumnOrder; + } + } +} \ No newline at end of file diff --git a/extensions/schema-compare/src/media/options-inverse.svg b/extensions/schema-compare/src/media/options-inverse.svg new file mode 100644 index 0000000000..5db3450f96 --- /dev/null +++ b/extensions/schema-compare/src/media/options-inverse.svg @@ -0,0 +1,3 @@ + + + diff --git a/extensions/schema-compare/src/media/options.svg b/extensions/schema-compare/src/media/options.svg new file mode 100644 index 0000000000..f36dbcc614 --- /dev/null +++ b/extensions/schema-compare/src/media/options.svg @@ -0,0 +1,3 @@ + + + diff --git a/extensions/schema-compare/src/schemaCompareResult.ts b/extensions/schema-compare/src/schemaCompareResult.ts index db44596301..e7c337be28 100644 --- a/extensions/schema-compare/src/schemaCompareResult.ts +++ b/extensions/schema-compare/src/schemaCompareResult.ts @@ -7,11 +7,17 @@ import * as nls from 'vscode-nls'; import * as azdata from 'azdata'; import * as vscode from 'vscode'; import * as os from 'os'; +import { SchemaCompareOptionsDialog } from './dialogs/schemaCompareOptionsDialog'; import * as path from 'path'; const localize = nls.loadMessageBundle(); export class SchemaCompareResult { private differencesTable: azdata.TableComponent; + private diffViewTopPane: azdata.FlexContainer; + private includeComponent: azdata.TableComponent; + private checkboxList: azdata.FlexContainer; + private checkBoxes: azdata.CheckBoxComponent[] = []; + private lastCheckBoxes: azdata.CheckBoxComponent[] = []; private loader: azdata.LoadingComponent; private editor: azdata.workspace.ModelViewEditor; private diffEditor: azdata.DiffEditorComponent; @@ -21,12 +27,17 @@ export class SchemaCompareResult { private sourceTargetFlexLayout: azdata.FlexContainer; private switchButton: azdata.ButtonComponent; private compareButton: azdata.ButtonComponent; + private optionsButton: azdata.ButtonComponent; private generateScriptButton: azdata.ButtonComponent; private applyButton: azdata.ButtonComponent; private SchemaCompareActionMap: Map; private comparisonResult: azdata.SchemaCompareResult; + private lastComparisonResult: azdata.SchemaCompareResult; private sourceNameComponent: azdata.TableComponent; private targetNameComponent: azdata.TableComponent; + private deploymentOptions: azdata.DeploymentOptions; + private schemaCompareOptionDialog: SchemaCompareOptionsDialog; + private viewModel: azdata.ModelView; constructor(private sourceName: string, private targetName: string, private sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, private targetEndpointInfo: azdata.SchemaCompareEndpointInfo) { this.SchemaCompareActionMap = new Map(); @@ -35,11 +46,30 @@ export class SchemaCompareResult { this.SchemaCompareActionMap[azdata.SchemaUpdateAction.Add] = localize('schemaCompare.addAction', 'Add'); this.editor = azdata.workspace.createModelViewEditor(localize('schemaCompare.Title', 'Schema Compare'), { retainContextWhenHidden: true, supportsSave: true }); + this.GetDefaultDeploymentOptions(); this.editor.registerContent(async view => { + + this.viewModel = view; this.differencesTable = view.modelBuilder.table().withProperties({ data: [], - height: 300, + height: 300 + }).component(); + + this.diffViewTopPane = view.modelBuilder.flexContainer().withLayout({ + flexFlow: 'row' + }).withProperties({ + alignItems: 'stretch', + horizontal: true + }).component(); + + this.checkboxList = view.modelBuilder.flexContainer().withLayout({ + flexFlow: 'column' + }).component(); + + this.includeComponent = view.modelBuilder.table().withProperties({ + data: [], + height: 28, }).component(); this.diffEditor = view.modelBuilder.diffeditor().withProperties({ @@ -67,6 +97,7 @@ export class SchemaCompareResult { this.createCompareButton(view); this.createGenerateScriptButton(view); this.createApplyButton(view); + this.createOptionsButton(view); this.resetButtons(); let toolBar = view.modelBuilder.toolbarContainer(); @@ -75,7 +106,9 @@ export class SchemaCompareResult { }, { component: this.generateScriptButton }, { - component: this.applyButton, + component: this.applyButton + }, { + component: this.optionsButton, toolbarSeparatorAfter: true }, { component: this.switchButton @@ -144,8 +177,13 @@ export class SchemaCompareResult { } private async execute(): Promise { + if (this.schemaCompareOptionDialog && this.schemaCompareOptionDialog.deploymentOptions) { + // take updates if any + this.deploymentOptions = this.schemaCompareOptionDialog.deploymentOptions; + } + let service = await SchemaCompareResult.getService('MSSQL'); - this.comparisonResult = await service.schemaCompare(this.sourceEndpointInfo, this.targetEndpointInfo, azdata.TaskExecutionMode.execute); + this.comparisonResult = await service.schemaCompare(this.sourceEndpointInfo, this.targetEndpointInfo, azdata.TaskExecutionMode.execute, this.deploymentOptions); if (!this.comparisonResult || !this.comparisonResult.success) { vscode.window.showErrorMessage(localize('schemaCompare.compareErrorMessage', "Schema Compare failed: {0}", this.comparisonResult.errorMessage ? this.comparisonResult.errorMessage : 'Unknown')); return; @@ -178,7 +216,24 @@ export class SchemaCompareResult { }] }); - this.splitView.addItem(this.differencesTable); + this.includeComponent.updateProperties({ + data: [], + columns: [ + { + value: localize('schemaCompare.Include', 'Include'), + cssClass: 'center-align', + width: 25 + } + ] + }); + + this.checkboxList.clearItems(); + this.checkboxList.addItem(this.includeComponent); + this.checkBoxes.forEach(box => this.checkboxList.addItem(box, { CSSStyles: { 'height': '24px', 'border-bottom': '1px #BDBDBD solid', 'border-right': '1px #BDBDBD dotted' } })); + this.diffViewTopPane.addItem(this.checkboxList, { CSSStyles: { 'margin-left': '10px', 'width': '4%' } }); + this.diffViewTopPane.addItem(this.differencesTable, { CSSStyles: { 'width': '96%' } }); + + this.splitView.addItem(this.diffViewTopPane); this.splitView.addItem(this.diffEditor); this.splitView.setLayout({ orientation: 'vertical', @@ -188,6 +243,7 @@ export class SchemaCompareResult { this.flexModel.removeItem(this.loader); this.switchButton.enabled = true; this.compareButton.enabled = true; + this.optionsButton.enabled = true; if (this.comparisonResult.differences.length > 0) { this.flexModel.addItem(this.splitView); @@ -223,10 +279,34 @@ export class SchemaCompareResult { private getAllDifferences(differences: azdata.DiffEntry[]): string[][] { let data = []; + this.checkBoxes = []; if (differences) { differences.forEach(difference => { if (difference.differenceType === azdata.SchemaDifferenceType.Object) { if (difference.sourceValue !== null || difference.targetValue !== null) { + let checkbox: azdata.CheckBoxComponent = this.viewModel.modelBuilder.checkBox().withProperties({ + checked: this.populateFromState(difference) + }).component(); + + checkbox.onChanged(async () => { + if (checkbox.checked) { + let service = await SchemaCompareResult.getService('MSSQL'); + let result = await service.schemaCompareIncludeExcludeNode(this.comparisonResult.operationId, difference, true, azdata.TaskExecutionMode.execute); + if (!result || !result.success) { + vscode.window.showErrorMessage( + localize('schemaCompare.includeNodeErrorMessage', "Include Node failed. Reason: '{0}'", (result && result.errorMessage) ? result.errorMessage : 'Unknown')); + } + } + else { + let service = await SchemaCompareResult.getService('MSSQL'); + let result = await service.schemaCompareIncludeExcludeNode(this.comparisonResult.operationId, difference, false, azdata.TaskExecutionMode.execute); + if (!result || !result.success) { + vscode.window.showErrorMessage( + localize('schemaCompare.excludeNodeErrorMessage', "Exclude Node failed. Reason: '{0}'", (result && result.errorMessage) ? result.errorMessage : 'Unknown')); + } + } + }); + this.checkBoxes.push(checkbox); data.push([difference.name, difference.sourceValue, this.SchemaCompareActionMap[difference.updateAction], difference.targetValue]); } } @@ -250,6 +330,18 @@ export class SchemaCompareResult { return script; } + private populateFromState(diffEntry: azdata.DiffEntry): boolean { + if (!this.lastComparisonResult || !this.lastCheckBoxes) { + return true; + } + let lastIndex = this.lastComparisonResult.differences.findIndex(x => x.sourceValue === diffEntry.sourceValue && x.targetValue === diffEntry.targetValue && x.name === diffEntry.name); + if (lastIndex === -1 || lastIndex >= this.lastCheckBoxes.length) { + // couldnt find the change or the check box corresponsing to it + return true; + } + return this.lastCheckBoxes[lastIndex].checked; + } + private reExecute(): void { this.flexModel.removeItem(this.splitView); this.flexModel.removeItem(this.noDifferencesLabel); @@ -260,6 +352,10 @@ export class SchemaCompareResult { }); this.differencesTable.selectedRows = null; this.resetButtons(); + + this.lastCheckBoxes = this.checkBoxes; + this.lastComparisonResult = this.comparisonResult; //To populate state related UX + this.execute(); } @@ -316,6 +412,27 @@ export class SchemaCompareResult { }); } + private createOptionsButton(view: azdata.ModelView) { + this.optionsButton = view.modelBuilder.button().withProperties({ + label: localize('schemaCompare.optionsButton', 'Options'), + iconPath: { + light: path.join(__dirname, 'media', 'options.svg'), + dark: path.join(__dirname, 'media', 'options_reverse.svg') + }, + title: localize('schemaCompare.optionsButtonTitle', 'Options') + }).component(); + + this.optionsButton.onDidClick(async (click) => { + //restore options from last time + if (this.schemaCompareOptionDialog && this.schemaCompareOptionDialog.deploymentOptions) { + this.deploymentOptions = this.schemaCompareOptionDialog.deploymentOptions; + } + // create fresh every time + this.schemaCompareOptionDialog = new SchemaCompareOptionsDialog(this.deploymentOptions); + await this.schemaCompareOptionDialog.openDialog(); + }); + } + private createApplyButton(view: azdata.ModelView) { this.applyButton = view.modelBuilder.button().withProperties({ @@ -338,6 +455,7 @@ export class SchemaCompareResult { private resetButtons(): void { this.compareButton.enabled = false; + this.optionsButton.enabled = false; this.switchButton.enabled = false; this.generateScriptButton.enabled = false; this.applyButton.enabled = false; @@ -390,4 +508,11 @@ export class SchemaCompareResult { let service = azdata.dataprotocol.getProvider(providerName, azdata.DataProviderType.SchemaCompareServicesProvider); return service; } + + private async GetDefaultDeploymentOptions(): Promise { + // Same as dacfx default options + let service = await SchemaCompareResult.getService('MSSQL'); + let result = await service.schemaCompareGetDefaultOptions(); + this.deploymentOptions = result.defaultDeploymentOptions; + } } \ No newline at end of file diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 78d65b65d8..515132448e 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -1742,10 +1742,166 @@ declare module 'azdata' { ownerUri: string; } + export interface SchemaCompareOptionsResult extends ResultStatus { + defaultDeploymentOptions: DeploymentOptions; + } + + export interface DeploymentOptions { + ignoreTableOptions: boolean; + ignoreSemicolonBetweenStatements: boolean; + ignoreRouteLifetime: boolean; + ignoreRoleMembership: boolean; + ignoreQuotedIdentifiers: boolean; + ignorePermissions: boolean; + ignorePartitionSchemes: boolean; + ignoreObjectPlacementOnPartitionScheme: boolean; + ignoreNotForReplication: boolean; + ignoreLoginSids: boolean; + ignoreLockHintsOnIndexes: boolean; + ignoreKeywordCasing: boolean; + ignoreIndexPadding: boolean; + ignoreIndexOptions: boolean; + ignoreIncrement: boolean; + ignoreIdentitySeed: boolean; + ignoreUserSettingsObjects: boolean; + ignoreFullTextCatalogFilePath: boolean; + ignoreWhitespace: boolean; + ignoreWithNocheckOnForeignKeys: boolean; + verifyCollationCompatibility: boolean; + unmodifiableObjectWarnings: boolean; + treatVerificationErrorsAsWarnings: boolean; + scriptRefreshModule: boolean; + scriptNewConstraintValidation: boolean; + scriptFileSize: boolean; + scriptDeployStateChecks: boolean; + scriptDatabaseOptions: boolean; + scriptDatabaseCompatibility: boolean; + scriptDatabaseCollation: boolean; + runDeploymentPlanExecutors: boolean; + registerDataTierApplication: boolean; + populateFilesOnFileGroups: boolean; + noAlterStatementsToChangeClrTypes: boolean; + includeTransactionalScripts: boolean; + includeCompositeObjects: boolean; + allowUnsafeRowLevelSecurityDataMovement: boolean; + ignoreWithNocheckOnCheckConstraints: boolean; + ignoreFillFactor: boolean; + ignoreFileSize: boolean; + ignoreFilegroupPlacement: boolean; + doNotAlterReplicatedObjects: boolean; + doNotAlterChangeDataCaptureObjects: boolean; + disableAndReenableDdlTriggers: boolean; + deployDatabaseInSingleUserMode: boolean; + createNewDatabase: boolean; + compareUsingTargetCollation: boolean; + commentOutSetVarDeclarations: boolean; + blockWhenDriftDetected: boolean; + blockOnPossibleDataLoss: boolean; + backupDatabaseBeforeChanges: boolean; + allowIncompatiblePlatform: boolean; + allowDropBlockingAssemblies: boolean; + dropConstraintsNotInSource: boolean; + dropDmlTriggersNotInSource: boolean; + dropExtendedPropertiesNotInSource: boolean; + dropIndexesNotInSource: boolean; + ignoreFileAndLogFilePath: boolean; + ignoreExtendedProperties: boolean; + ignoreDmlTriggerState: boolean; + ignoreDmlTriggerOrder: boolean; + ignoreDefaultSchema: boolean; + ignoreDdlTriggerState: boolean; + ignoreDdlTriggerOrder: boolean; + ignoreCryptographicProviderFilePath: boolean; + verifyDeployment: boolean; + ignoreComments: boolean; + ignoreColumnCollation: boolean; + ignoreAuthorizer: boolean; + ignoreAnsiNulls: boolean; + generateSmartDefaults: boolean; + dropStatisticsNotInSource: boolean; + dropRoleMembersNotInSource: boolean; + dropPermissionsNotInSource: boolean; + dropObjectsNotInSource: boolean; + ignoreColumnOrder: boolean; + doNotDropObjectTypes: SchemaObjectType[]; + excludeObjectTypes: SchemaObjectType[]; + } + + export enum SchemaObjectType { + aggregates = 0, + applicationRoles = 1, + assemblies = 2, + assemblyFiles = 3, + asymmetricKeys = 4, + brokerPriorities = 5, + certificates = 6, + columnEncryptionKeys = 7, + columnMasterKeys = 8, + contracts = 9, + databaseOptions = 10, + databaseRoles = 11, + databaseTriggers = 12, + defaults = 13, + extendedProperties = 14, + externalDataSources = 15, + externalFileFormats = 16, + externalTables = 17, + filegroups = 18, + fileTables = 19, + fullTextCatalogs = 20, + fullTextStoplists = 21, + messageTypes = 22, + partitionFunctions = 23, + partitionSchemes = 24, + permissions = 25, + queues = 26, + remoteServiceBindings = 27, + roleMembership = 28, + rules = 29, + scalarValuedFunctions = 30, + searchPropertyLists = 31, + securityPolicies = 32, + sequences = 33, + services = 34, + signatures = 35, + storedProcedures = 36, + symmetricKeys = 37, + synonyms = 38, + tables = 39, + tableValuedFunctions = 40, + userDefinedDataTypes = 41, + userDefinedTableTypes = 42, + clrUserDefinedTypes = 43, + users = 44, + views = 45, + xmlSchemaCollections = 46, + audits = 47, + credentials = 48, + cryptographicProviders = 49, + databaseAuditSpecifications = 50, + databaseEncryptionKeys = 51, + databaseScopedCredentials = 52, + endpoints = 53, + errorMessages = 54, + eventNotifications = 55, + eventSessions = 56, + linkedServerLogins = 57, + linkedServers = 58, + logins = 59, + masterKeys = 60, + routes = 61, + serverAuditSpecifications = 62, + serverRoleMembership = 63, + serverRoles = 64, + serverTriggers = 65 + } + export interface SchemaCompareServicesProvider extends DataProvider { - schemaCompare(sourceEndpointInfo: SchemaCompareEndpointInfo, targetEndpointInfo: SchemaCompareEndpointInfo, taskExecutionMode: TaskExecutionMode): Thenable; + schemaCompare(sourceEndpointInfo: SchemaCompareEndpointInfo, targetEndpointInfo: SchemaCompareEndpointInfo, taskExecutionMode: TaskExecutionMode, deploymentOptions: DeploymentOptions): Thenable; schemaCompareGenerateScript(operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: TaskExecutionMode): Thenable; schemaComparePublishChanges(operationId: string, targetServerName: string, targetDatabaseName: string, taskExecutionMode: TaskExecutionMode): Thenable; + schemaCompareGetDefaultOptions(): Thenable; + schemaCompareIncludeExcludeNode(operationId: string, diffEntry: DiffEntry, IncludeRequest: boolean, taskExecutionMode: TaskExecutionMode): Thenable; } // Security service interfaces ------------------------------------------------------------------------ diff --git a/src/sql/platform/schemaCompare/common/schemaCompareService.ts b/src/sql/platform/schemaCompare/common/schemaCompareService.ts index c3a078608c..e10c5dd244 100644 --- a/src/sql/platform/schemaCompare/common/schemaCompareService.ts +++ b/src/sql/platform/schemaCompare/common/schemaCompareService.ts @@ -17,9 +17,11 @@ export interface ISchemaCompareService { _serviceBrand: any; registerProvider(providerId: string, provider: azdata.SchemaCompareServicesProvider): void; - schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): void; + schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions): void; schemaCompareGenerateScript(operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): void; schemaComparePublishChanges(operationId: string, targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): void; + schemaCompareGetDefaultOptions(): void; + schemaCompareIncludeExcludeNode(operationId: string, diffEntry: azdata.DiffEntry, includeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): void; } export class SchemaCompareService implements ISchemaCompareService { @@ -32,9 +34,9 @@ export class SchemaCompareService implements ISchemaCompareService { this._providers[providerId] = provider; } - schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable { + schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions): Thenable { return this._runAction(sourceEndpointInfo.ownerUri, (runner) => { - return runner.schemaCompare(sourceEndpointInfo, targetEndpointInfo, taskExecutionMode); + return runner.schemaCompare(sourceEndpointInfo, targetEndpointInfo, taskExecutionMode, deploymentOptions); }); } @@ -50,6 +52,18 @@ export class SchemaCompareService implements ISchemaCompareService { }); } + schemaCompareGetDefaultOptions(): Thenable { + return this._runAction('', (runner) => { + return runner.schemaCompareGetDefaultOptions(); + }); + } + + schemaCompareIncludeExcludeNode(operationId: string, diffEntry: azdata.DiffEntry, includeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable { + return this._runAction('', (runner) => { + return runner.schemaCompareIncludeExcludeNode(operationId, diffEntry, includeRequest, taskExecutionMode); + }); + } + private _runAction(uri: string, action: (handler: azdata.SchemaCompareServicesProvider) => Thenable): Thenable { let providerId: string = this._connectionService.getProviderIdFromUri(uri); diff --git a/src/sql/workbench/api/common/sqlExtHostTypes.ts b/src/sql/workbench/api/common/sqlExtHostTypes.ts index 3a85f9ae71..831ca3cc1c 100644 --- a/src/sql/workbench/api/common/sqlExtHostTypes.ts +++ b/src/sql/workbench/api/common/sqlExtHostTypes.ts @@ -563,3 +563,72 @@ export enum SchemaCompareEndpointType { database = 0, dacpac = 1 } + +export enum SchemaObjectType { + aggregates = 0, + applicationRoles = 1, + assemblies = 2, + assemblyFiles = 3, + asymmetricKeys = 4, + brokerPriorities = 5, + certificates = 6, + columnEncryptionKeys = 7, + columnMasterKeys = 8, + contracts = 9, + databaseOptions = 10, + databaseRoles = 11, + databaseTriggers = 12, + defaults = 13, + extendedProperties = 14, + externalDataSources = 15, + externalFileFormats = 16, + externalTables = 17, + filegroups = 18, + fileTables = 19, + fullTextCatalogs = 20, + fullTextStoplists = 21, + messageTypes = 22, + partitionFunctions = 23, + partitionSchemes = 24, + permissions = 25, + queues = 26, + remoteServiceBindings = 27, + roleMembership = 28, + rules = 29, + scalarValuedFunctions = 30, + searchPropertyLists = 31, + securityPolicies = 32, + sequences = 33, + services = 34, + signatures = 35, + storedProcedures = 36, + symmetricKeys = 37, + synonyms = 38, + tables = 39, + tableValuedFunctions = 40, + userDefinedDataTypes = 41, + userDefinedTableTypes = 42, + clrUserDefinedTypes = 43, + users = 44, + views = 45, + xmlSchemaCollections = 46, + audits = 47, + credentials = 48, + cryptographicProviders = 49, + databaseAuditSpecifications = 50, + databaseEncryptionKeys = 51, + databaseScopedCredentials = 52, + endpoints = 53, + errorMessages = 54, + eventNotifications = 55, + eventSessions = 56, + linkedServerLogins = 57, + linkedServers = 58, + logins = 59, + masterKeys = 60, + routes = 61, + serverAuditSpecifications = 62, + serverRoleMembership = 63, + serverRoles = 64, + serverTriggers = 65 +} \ No newline at end of file diff --git a/src/sql/workbench/api/node/mainThreadDataProtocol.ts b/src/sql/workbench/api/node/mainThreadDataProtocol.ts index 0ba45183b2..ba2c6d4ed0 100644 --- a/src/sql/workbench/api/node/mainThreadDataProtocol.ts +++ b/src/sql/workbench/api/node/mainThreadDataProtocol.ts @@ -457,14 +457,20 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape { public $registerSchemaCompareServicesProvider(providerId: string, handle: number): Promise { const self = this; this._schemaCompareService.registerProvider(providerId, { - schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable { - return self._proxy.$schemaCompare(handle, sourceEndpointInfo, targetEndpointInfo, taskExecutionMode); + schemaCompare(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, schemaComapareOptions: azdata.DeploymentOptions): Thenable { + return self._proxy.$schemaCompare(handle, sourceEndpointInfo, targetEndpointInfo, taskExecutionMode, schemaComapareOptions); }, schemaCompareGenerateScript(operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable { return self._proxy.$schemaCompareGenerateScript(handle, operationId, targetDatabaseName, scriptFilePath, taskExecutionMode); }, schemaComparePublishChanges(operationId: string, targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable { return self._proxy.$schemaComparePublishChanges(handle, operationId, targetServerName, targetDatabaseName, taskExecutionMode); + }, + schemaCompareGetDefaultOptions(): Thenable { + return self._proxy.$schemaCompareGetDefaultOptions(handle); + }, + schemaCompareIncludeExcludeNode(operationId: string, diffEntry: azdata.DiffEntry, includeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable { + return self._proxy.$schemaCompareIncludeExcludeNode(handle, operationId, diffEntry, includeRequest, taskExecutionMode); } }); diff --git a/src/sql/workbench/api/node/sqlExtHost.api.impl.ts b/src/sql/workbench/api/node/sqlExtHost.api.impl.ts index efcad0537b..19add09bda 100644 --- a/src/sql/workbench/api/node/sqlExtHost.api.impl.ts +++ b/src/sql/workbench/api/node/sqlExtHost.api.impl.ts @@ -536,7 +536,8 @@ export function createApiFactory( extensions: extensions, SchemaUpdateAction: sqlExtHostTypes.SchemaUpdateAction, SchemaDifferenceType: sqlExtHostTypes.SchemaDifferenceType, - SchemaCompareEndpointType: sqlExtHostTypes.SchemaCompareEndpointType + SchemaCompareEndpointType: sqlExtHostTypes.SchemaCompareEndpointType, + SchemaObjectType: sqlExtHostTypes.SchemaObjectType }; }, diff --git a/src/sql/workbench/api/node/sqlExtHost.protocol.ts b/src/sql/workbench/api/node/sqlExtHost.protocol.ts index 41dd8ca35b..310c35d929 100644 --- a/src/sql/workbench/api/node/sqlExtHost.protocol.ts +++ b/src/sql/workbench/api/node/sqlExtHost.protocol.ts @@ -457,7 +457,7 @@ export abstract class ExtHostDataProtocolShape { /** * Schema compare */ - $schemaCompare(handle: number, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable { throw ni(); } + $schemaCompare(handle: number, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, schemaComapareOptions: azdata.DeploymentOptions): Thenable { throw ni(); } /** * Schema compare generate script @@ -468,6 +468,17 @@ export abstract class ExtHostDataProtocolShape { * Schema compare publish changes */ $schemaComparePublishChanges(handle: number, operationId: string, targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable { throw ni(); } + + /** + * Schema compare get default options + */ + $schemaCompareGetDefaultOptions(handle: number): Thenable { throw ni(); } + + + /** + * Schema comapre Include node + */ + $schemaCompareIncludeExcludeNode(handle: number, operationId: string, diffEntry: azdata.DiffEntry, includeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable { throw ni(); } } /**