Remove dacfx and schema compare from the azdata api (#6684)

* refactor mssql extension to directly expose dacfx and schema compare

* remove more code

* fix compile errors
This commit is contained in:
Anthony Dresser
2019-08-19 16:34:09 -07:00
committed by GitHub
parent 87b0e08a6a
commit 986ad33678
40 changed files with 1196 additions and 1556 deletions

View File

@@ -13,6 +13,7 @@ import { isNullOrUndefined } from 'util';
import { existsSync } from 'fs';
import { Telemetry } from '../telemetry';
import { getEndpointName } from '../utils';
import * as mssql from '../../../mssql';
const localize = nls.loadMessageBundle();
const OkButtonText: string = localize('schemaCompareDialog.ok', 'OK');
@@ -60,8 +61,8 @@ export class SchemaCompareDialog {
private connectionId: string;
private sourceDbEditable: string;
private taregtDbEditable: string;
private previousSource: azdata.SchemaCompareEndpointInfo;
private previousTarget: azdata.SchemaCompareEndpointInfo;
private previousSource: mssql.SchemaCompareEndpointInfo;
private previousTarget: mssql.SchemaCompareEndpointInfo;
constructor(private schemaCompareResult: SchemaCompareMainWindow) {
this.previousSource = schemaCompareResult.sourceEndpointInfo;
@@ -97,7 +98,7 @@ export class SchemaCompareDialog {
protected async execute(): Promise<void> {
if (this.sourceIsDacpac) {
this.schemaCompareResult.sourceEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -109,7 +110,7 @@ export class SchemaCompareDialog {
let ownerUri = await azdata.connection.getUriForConnection((this.sourceServerDropdown.value as ConnectionDropdownValue).connection.connectionId);
this.schemaCompareResult.sourceEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Database,
endpointType: mssql.SchemaCompareEndpointType.Database,
serverDisplayName: (this.sourceServerDropdown.value as ConnectionDropdownValue).displayName,
serverName: (this.sourceServerDropdown.value as ConnectionDropdownValue).name,
databaseName: (<azdata.CategoryValue>this.sourceDatabaseDropdown.value).name,
@@ -121,7 +122,7 @@ export class SchemaCompareDialog {
if (this.targetIsDacpac) {
this.schemaCompareResult.targetEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -133,7 +134,7 @@ export class SchemaCompareDialog {
let ownerUri = await azdata.connection.getUriForConnection((this.targetServerDropdown.value as ConnectionDropdownValue).connection.connectionId);
this.schemaCompareResult.targetEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Database,
endpointType: mssql.SchemaCompareEndpointType.Database,
serverDisplayName: (this.targetServerDropdown.value as ConnectionDropdownValue).displayName,
serverName: (this.targetServerDropdown.value as ConnectionDropdownValue).name,
databaseName: (<azdata.CategoryValue>this.targetDatabaseDropdown.value).name,
@@ -174,7 +175,7 @@ export class SchemaCompareDialog {
}
}
private endpointChanged(previousEndpoint: azdata.SchemaCompareEndpointInfo, updatedEndpoint: azdata.SchemaCompareEndpointInfo): boolean {
private endpointChanged(previousEndpoint: mssql.SchemaCompareEndpointInfo, updatedEndpoint: mssql.SchemaCompareEndpointInfo): boolean {
if (previousEndpoint && updatedEndpoint) {
return getEndpointName(previousEndpoint).toLowerCase() !== getEndpointName(updatedEndpoint).toLowerCase()
|| (previousEndpoint.serverDisplayName && updatedEndpoint.serverDisplayName && previousEndpoint.serverDisplayName.toLowerCase() !== updatedEndpoint.serverDisplayName.toLowerCase());
@@ -234,7 +235,7 @@ export class SchemaCompareDialog {
let targetComponents = [];
// start source and target with either dacpac or database selection based on what the previous value was
if (this.schemaCompareResult.sourceEndpointInfo && this.schemaCompareResult.sourceEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (this.schemaCompareResult.sourceEndpointInfo && this.schemaCompareResult.sourceEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
sourceComponents = [
sourceRadioButtons,
this.sourceServerComponent,
@@ -247,7 +248,7 @@ export class SchemaCompareDialog {
];
}
if (this.schemaCompareResult.targetEndpointInfo && this.schemaCompareResult.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (this.schemaCompareResult.targetEndpointInfo && this.schemaCompareResult.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
targetComponents = [
targetRadioButtons,
this.targetServerComponent,
@@ -283,7 +284,7 @@ export class SchemaCompareDialog {
});
}
private async createFileBrowser(view: azdata.ModelView, isTarget: boolean, endpoint: azdata.SchemaCompareEndpointInfo): Promise<azdata.FormComponent> {
private async createFileBrowser(view: azdata.ModelView, isTarget: boolean, endpoint: mssql.SchemaCompareEndpointInfo): Promise<azdata.FormComponent> {
let currentTextbox = isTarget ? this.targetTextBox : this.sourceTextBox;
if (isTarget) {
this.targetFileButton = view.modelBuilder.button().withProperties({
@@ -367,7 +368,7 @@ export class SchemaCompareDialog {
});
// if source is currently a db, show it in the server and db dropdowns
if (this.schemaCompareResult.sourceEndpointInfo && this.schemaCompareResult.sourceEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (this.schemaCompareResult.sourceEndpointInfo && this.schemaCompareResult.sourceEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
databaseRadioButton.checked = true;
this.sourceIsDacpac = false;
} else {
@@ -422,7 +423,7 @@ export class SchemaCompareDialog {
});
// if target is currently a db, show it in the server and db dropdowns
if (this.schemaCompareResult.targetEndpointInfo && this.schemaCompareResult.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (this.schemaCompareResult.targetEndpointInfo && this.schemaCompareResult.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
databaseRadioButton.checked = true;
this.targetIsDacpac = false;
} else {

View File

@@ -7,6 +7,7 @@
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as mssql from '../../../mssql';
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
import { isNullOrUndefined } from 'util';
@@ -246,7 +247,7 @@ export class SchemaCompareOptionsDialog {
private static readonly descriptionIgnoreColumnOrder: string = localize('SchemaCompare.Description.IgnoreColumnOrder', 'Specifies whether differences in table column order should be ignored or updated when you publish to a database.');
public dialog: azdata.window.Dialog;
public deploymentOptions: azdata.DeploymentOptions;
public deploymentOptions: mssql.DeploymentOptions;
private generalOptionsTab: azdata.window.DialogTab;
private objectTypesTab: azdata.window.DialogTab;
@@ -261,7 +262,7 @@ export class SchemaCompareOptionsDialog {
private objectsLookup = {};
private disposableListeners: vscode.Disposable[] = [];
private excludedObjectTypes: azdata.SchemaObjectType[] = [];
private excludedObjectTypes: mssql.SchemaObjectType[] = [];
private optionsChanged: boolean = false;
private optionsLabels: string[] = [
@@ -413,7 +414,7 @@ export class SchemaCompareOptionsDialog {
SchemaCompareOptionsDialog.ServerTriggers
].sort();
constructor(defaultOptions: azdata.DeploymentOptions, private schemaComparison: SchemaCompareMainWindow) {
constructor(defaultOptions: mssql.DeploymentOptions, private schemaComparison: SchemaCompareMainWindow) {
this.deploymentOptions = defaultOptions;
}
@@ -465,7 +466,7 @@ export class SchemaCompareOptionsDialog {
}
private async reset() {
let service = await azdata.dataprotocol.getProvider<azdata.SchemaCompareServicesProvider>('MSSQL', azdata.DataProviderType.SchemaCompareServicesProvider);
let service = (vscode.extensions.getExtension(mssql.extension.name).exports as mssql.mssql).schemaCompare;
let result = await service.schemaCompareGetDefaultOptions();
this.deploymentOptions = result.defaultDeploymentOptions;
this.optionsChanged = true;
@@ -1111,139 +1112,139 @@ export class SchemaCompareOptionsDialog {
private GetSchemaCompareIncludedObjectsUtil(label): boolean {
switch (label) {
case SchemaCompareOptionsDialog.Aggregates:
return !isNullOrUndefined(this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Aggregates)) ? false : true;
return !isNullOrUndefined(this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Aggregates)) ? false : true;
case SchemaCompareOptionsDialog.ApplicationRoles:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ApplicationRoles)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ApplicationRoles)) ? false : true;
case SchemaCompareOptionsDialog.Assemblies:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Assemblies)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Assemblies)) ? false : true;
case SchemaCompareOptionsDialog.AssemblyFiles:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.AssemblyFiles)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.AssemblyFiles)) ? false : true;
case SchemaCompareOptionsDialog.AsymmetricKeys:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.AsymmetricKeys)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.AsymmetricKeys)) ? false : true;
case SchemaCompareOptionsDialog.BrokerPriorities:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.BrokerPriorities)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.BrokerPriorities)) ? false : true;
case SchemaCompareOptionsDialog.Certificates:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Certificates)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Certificates)) ? false : true;
case SchemaCompareOptionsDialog.ColumnEncryptionKeys:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ColumnEncryptionKeys)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ColumnEncryptionKeys)) ? false : true;
case SchemaCompareOptionsDialog.ColumnMasterKeys:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ColumnMasterKeys)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ColumnMasterKeys)) ? false : true;
case SchemaCompareOptionsDialog.Contracts:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Contracts)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Contracts)) ? false : true;
case SchemaCompareOptionsDialog.DatabaseOptions:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.DatabaseOptions)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.DatabaseOptions)) ? false : true;
case SchemaCompareOptionsDialog.DatabaseRoles:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.DatabaseRoles)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.DatabaseRoles)) ? false : true;
case SchemaCompareOptionsDialog.DatabaseTriggers:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.DatabaseTriggers)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.DatabaseTriggers)) ? false : true;
case SchemaCompareOptionsDialog.Defaults:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Defaults)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Defaults)) ? false : true;
case SchemaCompareOptionsDialog.ExtendedProperties:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ExtendedProperties)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ExtendedProperties)) ? false : true;
case SchemaCompareOptionsDialog.ExternalDataSources:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ExternalDataSources)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ExternalDataSources)) ? false : true;
case SchemaCompareOptionsDialog.ExternalFileFormats:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ExternalFileFormats)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ExternalFileFormats)) ? false : true;
case SchemaCompareOptionsDialog.ExternalTables:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ExternalTables)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ExternalTables)) ? false : true;
case SchemaCompareOptionsDialog.Filegroups:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Filegroups)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Filegroups)) ? false : true;
case SchemaCompareOptionsDialog.Files:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Files)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Files)) ? false : true;
case SchemaCompareOptionsDialog.FileTables:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.FileTables)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.FileTables)) ? false : true;
case SchemaCompareOptionsDialog.FullTextCatalogs:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.FullTextCatalogs)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.FullTextCatalogs)) ? false : true;
case SchemaCompareOptionsDialog.FullTextStoplists:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.FullTextStoplists)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.FullTextStoplists)) ? false : true;
case SchemaCompareOptionsDialog.MessageTypes:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.MessageTypes)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.MessageTypes)) ? false : true;
case SchemaCompareOptionsDialog.PartitionFunctions:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.PartitionFunctions)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.PartitionFunctions)) ? false : true;
case SchemaCompareOptionsDialog.PartitionSchemes:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.PartitionSchemes)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.PartitionSchemes)) ? false : true;
case SchemaCompareOptionsDialog.Permissions:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Permissions)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Permissions)) ? false : true;
case SchemaCompareOptionsDialog.Queues:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Queues)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Queues)) ? false : true;
case SchemaCompareOptionsDialog.RemoteServiceBindings:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.RemoteServiceBindings)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.RemoteServiceBindings)) ? false : true;
case SchemaCompareOptionsDialog.RoleMembership:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.RoleMembership)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.RoleMembership)) ? false : true;
case SchemaCompareOptionsDialog.Rules:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Rules)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Rules)) ? false : true;
case SchemaCompareOptionsDialog.ScalarValuedFunctions:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ScalarValuedFunctions)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ScalarValuedFunctions)) ? false : true;
case SchemaCompareOptionsDialog.SearchPropertyLists:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.SearchPropertyLists)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.SearchPropertyLists)) ? false : true;
case SchemaCompareOptionsDialog.SecurityPolicies:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.SecurityPolicies)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.SecurityPolicies)) ? false : true;
case SchemaCompareOptionsDialog.Sequences:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Sequences)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Sequences)) ? false : true;
case SchemaCompareOptionsDialog.Services:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Services)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Services)) ? false : true;
case SchemaCompareOptionsDialog.Signatures:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Signatures)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Signatures)) ? false : true;
case SchemaCompareOptionsDialog.StoredProcedures:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.StoredProcedures)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.StoredProcedures)) ? false : true;
case SchemaCompareOptionsDialog.SymmetricKeys:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.SymmetricKeys)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.SymmetricKeys)) ? false : true;
case SchemaCompareOptionsDialog.Synonyms:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Synonyms)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Synonyms)) ? false : true;
case SchemaCompareOptionsDialog.Tables:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Tables)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Tables)) ? false : true;
case SchemaCompareOptionsDialog.TableValuedFunctions:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.TableValuedFunctions)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.TableValuedFunctions)) ? false : true;
case SchemaCompareOptionsDialog.UserDefinedDataTypes:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.UserDefinedDataTypes)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.UserDefinedDataTypes)) ? false : true;
case SchemaCompareOptionsDialog.UserDefinedTableTypes:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.UserDefinedTableTypes)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.UserDefinedTableTypes)) ? false : true;
case SchemaCompareOptionsDialog.ClrUserDefinedTypes:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ClrUserDefinedTypes)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ClrUserDefinedTypes)) ? false : true;
case SchemaCompareOptionsDialog.Users:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Users)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Users)) ? false : true;
case SchemaCompareOptionsDialog.Views:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Views)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Views)) ? false : true;
case SchemaCompareOptionsDialog.XmlSchemaCollections:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.XmlSchemaCollections)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.XmlSchemaCollections)) ? false : true;
case SchemaCompareOptionsDialog.Audits:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Audits)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Audits)) ? false : true;
case SchemaCompareOptionsDialog.Credentials:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Credentials)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Credentials)) ? false : true;
case SchemaCompareOptionsDialog.CryptographicProviders:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.CryptographicProviders)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.CryptographicProviders)) ? false : true;
case SchemaCompareOptionsDialog.DatabaseAuditSpecifications:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.DatabaseAuditSpecifications)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.DatabaseAuditSpecifications)) ? false : true;
case SchemaCompareOptionsDialog.DatabaseEncryptionKeys:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.DatabaseEncryptionKeys)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.DatabaseEncryptionKeys)) ? false : true;
case SchemaCompareOptionsDialog.DatabaseScopedCredentials:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.DatabaseScopedCredentials)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.DatabaseScopedCredentials)) ? false : true;
case SchemaCompareOptionsDialog.Endpoints:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Endpoints)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Endpoints)) ? false : true;
case SchemaCompareOptionsDialog.ErrorMessages:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ErrorMessages)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ErrorMessages)) ? false : true;
case SchemaCompareOptionsDialog.EventNotifications:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.EventNotifications)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.EventNotifications)) ? false : true;
case SchemaCompareOptionsDialog.EventSessions:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.EventSessions)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.EventSessions)) ? false : true;
case SchemaCompareOptionsDialog.LinkedServerLogins:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.LinkedServerLogins)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.LinkedServerLogins)) ? false : true;
case SchemaCompareOptionsDialog.LinkedServers:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.LinkedServers)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.LinkedServers)) ? false : true;
case SchemaCompareOptionsDialog.Logins:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Logins)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Logins)) ? false : true;
case SchemaCompareOptionsDialog.MasterKeys:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.MasterKeys)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.MasterKeys)) ? false : true;
case SchemaCompareOptionsDialog.Routes:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.Routes)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.Routes)) ? false : true;
case SchemaCompareOptionsDialog.ServerAuditSpecifications:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ServerAuditSpecifications)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ServerAuditSpecifications)) ? false : true;
case SchemaCompareOptionsDialog.ServerRoleMembership:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ServerRoleMembership)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ServerRoleMembership)) ? false : true;
case SchemaCompareOptionsDialog.ServerRoles:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ServerRoles)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ServerRoles)) ? false : true;
case SchemaCompareOptionsDialog.ServerTriggers:
return (this.deploymentOptions.excludeObjectTypes.find(x => x === azdata.SchemaObjectType.ServerTriggers)) ? false : true;
return (this.deploymentOptions.excludeObjectTypes.find(x => x === mssql.SchemaObjectType.ServerTriggers)) ? false : true;
}
return false;
}
@@ -1252,337 +1253,337 @@ export class SchemaCompareOptionsDialog {
switch (label) {
case SchemaCompareOptionsDialog.Aggregates:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Aggregates);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Aggregates);
}
return;
case SchemaCompareOptionsDialog.ApplicationRoles:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ApplicationRoles);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ApplicationRoles);
}
return;
case SchemaCompareOptionsDialog.Assemblies:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Assemblies);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Assemblies);
}
return;
case SchemaCompareOptionsDialog.AssemblyFiles:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.AssemblyFiles);
this.excludedObjectTypes.push(mssql.SchemaObjectType.AssemblyFiles);
}
return;
case SchemaCompareOptionsDialog.AsymmetricKeys:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.AsymmetricKeys);
this.excludedObjectTypes.push(mssql.SchemaObjectType.AsymmetricKeys);
}
return;
case SchemaCompareOptionsDialog.BrokerPriorities:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.BrokerPriorities);
this.excludedObjectTypes.push(mssql.SchemaObjectType.BrokerPriorities);
}
return;
case SchemaCompareOptionsDialog.Certificates:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Certificates);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Certificates);
}
return;
case SchemaCompareOptionsDialog.ColumnEncryptionKeys:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ColumnEncryptionKeys);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ColumnEncryptionKeys);
}
return;
case SchemaCompareOptionsDialog.ColumnMasterKeys:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ColumnMasterKeys);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ColumnMasterKeys);
}
return;
case SchemaCompareOptionsDialog.Contracts:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Contracts);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Contracts);
}
return;
case SchemaCompareOptionsDialog.DatabaseOptions:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.DatabaseOptions);
this.excludedObjectTypes.push(mssql.SchemaObjectType.DatabaseOptions);
}
return;
case SchemaCompareOptionsDialog.DatabaseRoles:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.DatabaseRoles);
this.excludedObjectTypes.push(mssql.SchemaObjectType.DatabaseRoles);
}
return;
case SchemaCompareOptionsDialog.DatabaseTriggers:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.DatabaseTriggers);
this.excludedObjectTypes.push(mssql.SchemaObjectType.DatabaseTriggers);
}
return;
case SchemaCompareOptionsDialog.Defaults:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Defaults);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Defaults);
}
return;
case SchemaCompareOptionsDialog.ExtendedProperties:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ExtendedProperties);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ExtendedProperties);
}
return;
case SchemaCompareOptionsDialog.ExternalDataSources:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ExternalDataSources);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ExternalDataSources);
}
return;
case SchemaCompareOptionsDialog.ExternalFileFormats:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ExternalFileFormats);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ExternalFileFormats);
}
return;
case SchemaCompareOptionsDialog.ExternalTables:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ExternalTables);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ExternalTables);
}
return;
case SchemaCompareOptionsDialog.Filegroups:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Filegroups);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Filegroups);
}
return;
case SchemaCompareOptionsDialog.Files:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Files);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Files);
}
return;
case SchemaCompareOptionsDialog.FileTables:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.FileTables);
this.excludedObjectTypes.push(mssql.SchemaObjectType.FileTables);
}
return;
case SchemaCompareOptionsDialog.FullTextCatalogs:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.FullTextCatalogs);
this.excludedObjectTypes.push(mssql.SchemaObjectType.FullTextCatalogs);
}
return;
case SchemaCompareOptionsDialog.FullTextStoplists:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.FullTextStoplists);
this.excludedObjectTypes.push(mssql.SchemaObjectType.FullTextStoplists);
}
return;
case SchemaCompareOptionsDialog.MessageTypes:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.MessageTypes);
this.excludedObjectTypes.push(mssql.SchemaObjectType.MessageTypes);
}
return;
case SchemaCompareOptionsDialog.PartitionFunctions:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.PartitionFunctions);
this.excludedObjectTypes.push(mssql.SchemaObjectType.PartitionFunctions);
}
return;
case SchemaCompareOptionsDialog.PartitionSchemes:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.PartitionSchemes);
this.excludedObjectTypes.push(mssql.SchemaObjectType.PartitionSchemes);
}
return;
case SchemaCompareOptionsDialog.Permissions:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Permissions);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Permissions);
}
return;
case SchemaCompareOptionsDialog.Queues:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Queues);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Queues);
}
return;
case SchemaCompareOptionsDialog.RemoteServiceBindings:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.RemoteServiceBindings);
this.excludedObjectTypes.push(mssql.SchemaObjectType.RemoteServiceBindings);
}
return;
case SchemaCompareOptionsDialog.RoleMembership:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.RoleMembership);
this.excludedObjectTypes.push(mssql.SchemaObjectType.RoleMembership);
}
return;
case SchemaCompareOptionsDialog.Rules:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Rules);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Rules);
}
return;
case SchemaCompareOptionsDialog.ScalarValuedFunctions:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ScalarValuedFunctions);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ScalarValuedFunctions);
}
return;
case SchemaCompareOptionsDialog.SearchPropertyLists:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.SearchPropertyLists);
this.excludedObjectTypes.push(mssql.SchemaObjectType.SearchPropertyLists);
}
return;
case SchemaCompareOptionsDialog.SecurityPolicies:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.SecurityPolicies);
this.excludedObjectTypes.push(mssql.SchemaObjectType.SecurityPolicies);
}
return;
case SchemaCompareOptionsDialog.Sequences:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Sequences);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Sequences);
}
return;
case SchemaCompareOptionsDialog.Services:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Services);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Services);
}
return;
case SchemaCompareOptionsDialog.Signatures:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Signatures);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Signatures);
}
return;
case SchemaCompareOptionsDialog.StoredProcedures:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.StoredProcedures);
this.excludedObjectTypes.push(mssql.SchemaObjectType.StoredProcedures);
}
return;
case SchemaCompareOptionsDialog.SymmetricKeys:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.SymmetricKeys);
this.excludedObjectTypes.push(mssql.SchemaObjectType.SymmetricKeys);
}
return;
case SchemaCompareOptionsDialog.Synonyms:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Synonyms);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Synonyms);
}
return;
case SchemaCompareOptionsDialog.Tables:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Tables);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Tables);
}
return;
case SchemaCompareOptionsDialog.TableValuedFunctions:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.TableValuedFunctions);
this.excludedObjectTypes.push(mssql.SchemaObjectType.TableValuedFunctions);
}
return;
case SchemaCompareOptionsDialog.UserDefinedDataTypes:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.UserDefinedDataTypes);
this.excludedObjectTypes.push(mssql.SchemaObjectType.UserDefinedDataTypes);
}
return;
case SchemaCompareOptionsDialog.UserDefinedTableTypes:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.UserDefinedTableTypes);
this.excludedObjectTypes.push(mssql.SchemaObjectType.UserDefinedTableTypes);
}
return;
case SchemaCompareOptionsDialog.ClrUserDefinedTypes:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ClrUserDefinedTypes);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ClrUserDefinedTypes);
}
return;
case SchemaCompareOptionsDialog.Users:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Users);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Users);
}
return;
case SchemaCompareOptionsDialog.Views:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Views);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Views);
}
return;
case SchemaCompareOptionsDialog.XmlSchemaCollections:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.XmlSchemaCollections);
this.excludedObjectTypes.push(mssql.SchemaObjectType.XmlSchemaCollections);
}
return;
case SchemaCompareOptionsDialog.Audits:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Audits);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Audits);
}
return;
case SchemaCompareOptionsDialog.Credentials:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Credentials);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Credentials);
}
return;
case SchemaCompareOptionsDialog.CryptographicProviders:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.CryptographicProviders);
this.excludedObjectTypes.push(mssql.SchemaObjectType.CryptographicProviders);
}
return;
case SchemaCompareOptionsDialog.DatabaseAuditSpecifications:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.DatabaseAuditSpecifications);
this.excludedObjectTypes.push(mssql.SchemaObjectType.DatabaseAuditSpecifications);
}
return;
case SchemaCompareOptionsDialog.DatabaseEncryptionKeys:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.DatabaseEncryptionKeys);
this.excludedObjectTypes.push(mssql.SchemaObjectType.DatabaseEncryptionKeys);
}
return;
case SchemaCompareOptionsDialog.DatabaseScopedCredentials:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.DatabaseScopedCredentials);
this.excludedObjectTypes.push(mssql.SchemaObjectType.DatabaseScopedCredentials);
}
return;
case SchemaCompareOptionsDialog.Endpoints:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Endpoints);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Endpoints);
}
return;
case SchemaCompareOptionsDialog.ErrorMessages:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ErrorMessages);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ErrorMessages);
}
return;
case SchemaCompareOptionsDialog.EventNotifications:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.EventNotifications);
this.excludedObjectTypes.push(mssql.SchemaObjectType.EventNotifications);
}
return;
case SchemaCompareOptionsDialog.EventSessions:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.EventSessions);
this.excludedObjectTypes.push(mssql.SchemaObjectType.EventSessions);
}
return;
case SchemaCompareOptionsDialog.LinkedServerLogins:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.LinkedServerLogins);
this.excludedObjectTypes.push(mssql.SchemaObjectType.LinkedServerLogins);
}
return;
case SchemaCompareOptionsDialog.LinkedServers:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.LinkedServers);
this.excludedObjectTypes.push(mssql.SchemaObjectType.LinkedServers);
}
return;
case SchemaCompareOptionsDialog.Logins:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Logins);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Logins);
}
return;
case SchemaCompareOptionsDialog.MasterKeys:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.MasterKeys);
this.excludedObjectTypes.push(mssql.SchemaObjectType.MasterKeys);
}
return;
case SchemaCompareOptionsDialog.Routes:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.Routes);
this.excludedObjectTypes.push(mssql.SchemaObjectType.Routes);
}
return;
case SchemaCompareOptionsDialog.ServerAuditSpecifications:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ServerAuditSpecifications);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ServerAuditSpecifications);
}
return;
case SchemaCompareOptionsDialog.ServerRoleMembership:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ServerRoleMembership);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ServerRoleMembership);
}
return;
case SchemaCompareOptionsDialog.ServerRoles:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ServerRoles);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ServerRoles);
}
return;
case SchemaCompareOptionsDialog.ServerTriggers:
if (!included) {
this.excludedObjectTypes.push(azdata.SchemaObjectType.ServerTriggers);
this.excludedObjectTypes.push(mssql.SchemaObjectType.ServerTriggers);
}
return;
}

View File

@@ -8,6 +8,7 @@ import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as os from 'os';
import * as path from 'path';
import * as mssql from '../../mssql';
import { SchemaCompareOptionsDialog } from './dialogs/schemaCompareOptionsDialog';
import { Telemetry } from './telemetry';
import { getTelemetryErrorType, getEndpointName, verifyConnectionAndGetOwnerUri } from './utils';
@@ -56,28 +57,28 @@ export class SchemaCompareMainWindow {
private saveScmpButton: azdata.ButtonComponent;
private SchemaCompareActionMap: Map<Number, string>;
private operationId: string;
private comparisonResult: azdata.SchemaCompareResult;
private comparisonResult: mssql.SchemaCompareResult;
private sourceNameComponent: azdata.TableComponent;
private targetNameComponent: azdata.TableComponent;
private deploymentOptions: azdata.DeploymentOptions;
private deploymentOptions: mssql.DeploymentOptions;
private schemaCompareOptionDialog: SchemaCompareOptionsDialog;
private tablelistenersToDispose: vscode.Disposable[] = [];
private originalSourceExcludes = new Map<string, azdata.DiffEntry>();
private originalTargetExcludes = new Map<string, azdata.DiffEntry>();
private originalSourceExcludes = new Map<string, mssql.DiffEntry>();
private originalTargetExcludes = new Map<string, mssql.DiffEntry>();
private sourceTargetSwitched = false;
private sourceName: string;
private targetName: string;
private scmpSourceExcludes: azdata.SchemaCompareObjectId[];
private scmpTargetExcludes: azdata.SchemaCompareObjectId[];
private scmpSourceExcludes: mssql.SchemaCompareObjectId[];
private scmpTargetExcludes: mssql.SchemaCompareObjectId[];
public sourceEndpointInfo: azdata.SchemaCompareEndpointInfo;
public targetEndpointInfo: azdata.SchemaCompareEndpointInfo;
public sourceEndpointInfo: mssql.SchemaCompareEndpointInfo;
public targetEndpointInfo: mssql.SchemaCompareEndpointInfo;
constructor() {
this.SchemaCompareActionMap = new Map<Number, string>();
this.SchemaCompareActionMap[azdata.SchemaUpdateAction.Delete] = localize('schemaCompare.deleteAction', 'Delete');
this.SchemaCompareActionMap[azdata.SchemaUpdateAction.Change] = localize('schemaCompare.changeAction', 'Change');
this.SchemaCompareActionMap[azdata.SchemaUpdateAction.Add] = localize('schemaCompare.addAction', 'Add');
this.SchemaCompareActionMap[mssql.SchemaUpdateAction.Delete] = localize('schemaCompare.deleteAction', 'Delete');
this.SchemaCompareActionMap[mssql.SchemaUpdateAction.Change] = localize('schemaCompare.changeAction', 'Change');
this.SchemaCompareActionMap[mssql.SchemaUpdateAction.Add] = localize('schemaCompare.addAction', 'Add');
this.editor = azdata.workspace.createModelViewEditor(localize('schemaCompare.Title', 'Schema Compare'), { retainContextWhenHidden: true, supportsSave: true, resourceName: schemaCompareResourceName });
}
@@ -88,7 +89,7 @@ export class SchemaCompareMainWindow {
if (profile) {
let ownerUri = await azdata.connection.getUriForConnection((profile.id));
this.sourceEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Database,
endpointType: mssql.SchemaCompareEndpointType.Database,
serverDisplayName: `${profile.serverName} ${profile.userName}`,
serverName: profile.serverName,
databaseName: profile.databaseName,
@@ -257,16 +258,16 @@ export class SchemaCompareMainWindow {
}
// only for test
public getComparisonResult(): azdata.SchemaCompareResult {
public getComparisonResult(): mssql.SchemaCompareResult {
return this.comparisonResult;
}
// only for test
public getDeploymentOptions(): azdata.DeploymentOptions {
public getDeploymentOptions(): mssql.DeploymentOptions {
return this.deploymentOptions;
}
public setDeploymentOptions(deploymentOptions: azdata.DeploymentOptions): void {
public setDeploymentOptions(deploymentOptions: mssql.DeploymentOptions): void {
this.deploymentOptions = deploymentOptions;
}
@@ -348,7 +349,7 @@ export class SchemaCompareMainWindow {
this.flexModel.addItem(this.splitView, { CSSStyles: { 'overflow': 'hidden' } });
// only enable generate script button if the target is a db
if (this.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (this.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
this.generateScriptButton.enabled = true;
this.applyButton.enabled = true;
} else {
@@ -435,7 +436,7 @@ export class SchemaCompareMainWindow {
}
}
private shouldDiffBeIncluded(diff: azdata.DiffEntry): boolean {
private shouldDiffBeIncluded(diff: mssql.DiffEntry): boolean {
let key = (diff.sourceValue && diff.sourceValue.length > 0) ? this.createName(diff.sourceValue) : this.createName(diff.targetValue);
if (key) {
if (this.sourceTargetSwitched === true
@@ -453,7 +454,7 @@ export class SchemaCompareMainWindow {
return true;
}
private hasExcludeEntry(collection: azdata.SchemaCompareObjectId[], entryName: string): boolean {
private hasExcludeEntry(collection: mssql.SchemaCompareObjectId[], entryName: string): boolean {
let found = false;
if (collection) {
const index = collection.findIndex(e => this.createName(e.nameParts) === entryName);
@@ -462,7 +463,7 @@ export class SchemaCompareMainWindow {
return found;
}
private removeExcludeEntry(collection: azdata.SchemaCompareObjectId[], entryName: string) {
private removeExcludeEntry(collection: mssql.SchemaCompareObjectId[], entryName: string) {
if (collection) {
console.error('removing ' + entryName);
const index = collection.findIndex(e => this.createName(e.nameParts) === entryName);
@@ -470,12 +471,12 @@ export class SchemaCompareMainWindow {
}
}
private getAllDifferences(differences: azdata.DiffEntry[]): string[][] {
private getAllDifferences(differences: mssql.DiffEntry[]): string[][] {
let data = [];
let finalDifferences: azdata.DiffEntry[] = [];
let finalDifferences: mssql.DiffEntry[] = [];
if (differences) {
differences.forEach(difference => {
if (difference.differenceType === azdata.SchemaDifferenceType.Object) {
if (difference.differenceType === mssql.SchemaDifferenceType.Object) {
if ((difference.sourceValue !== null && difference.sourceValue.length > 0) || (difference.targetValue !== null && difference.targetValue.length > 0)) {
finalDifferences.push(difference); // Add only non-null changes to ensure index does not mismatch between dictionay and UI - #6234
let state: boolean = this.shouldDiffBeIncluded(difference);
@@ -495,7 +496,7 @@ export class SchemaCompareMainWindow {
return nameParts.join('.');
}
private getFormattedScript(diffEntry: azdata.DiffEntry, getSourceScript: boolean): string {
private getFormattedScript(diffEntry: mssql.DiffEntry, getSourceScript: boolean): string {
// if there is no entry, the script has to be \n because an empty string shows up as a difference but \n doesn't
if ((getSourceScript && diffEntry.sourceScript === null)
|| (!getSourceScript && diffEntry.targetScript === null)) {
@@ -506,7 +507,7 @@ export class SchemaCompareMainWindow {
return script;
}
private getAggregatedScript(diffEntry: azdata.DiffEntry, getSourceScript: boolean): string {
private getAggregatedScript(diffEntry: mssql.DiffEntry, getSourceScript: boolean): string {
let script = '';
if (diffEntry !== null) {
let diffEntryScript = getSourceScript ? diffEntry.sourceScript : diffEntry.targetScript;
@@ -880,7 +881,7 @@ export class SchemaCompareMainWindow {
return;
}
if (result.sourceEndpointInfo && result.sourceEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (result.sourceEndpointInfo && result.sourceEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
// only set endpoint info if able to connect to the database
const ownerUri = await verifyConnectionAndGetOwnerUri(result.sourceEndpointInfo);
if (ownerUri) {
@@ -890,7 +891,7 @@ export class SchemaCompareMainWindow {
} else {
// need to do this instead of just setting it to the result.sourceEndpointInfo because some fields are null which will cause an error when sending the compare request
this.sourceEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -900,7 +901,7 @@ export class SchemaCompareMainWindow {
};
}
if (result.targetEndpointInfo && result.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (result.targetEndpointInfo && result.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
const ownerUri = await verifyConnectionAndGetOwnerUri(result.targetEndpointInfo);
if (ownerUri) {
this.targetEndpointInfo = result.targetEndpointInfo;
@@ -909,7 +910,7 @@ export class SchemaCompareMainWindow {
} else {
// need to do this instead of just setting it to the result.targetEndpointInfo because some fields are null which will cause an error when sending the compare request
this.targetEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -962,8 +963,8 @@ export class SchemaCompareMainWindow {
}
// convert include/exclude maps to arrays of object ids
let sourceExcludes: azdata.SchemaCompareObjectId[] = this.convertExcludesToObjectIds(this.originalSourceExcludes);
let targetExcludes: azdata.SchemaCompareObjectId[] = this.convertExcludesToObjectIds(this.originalTargetExcludes);
let sourceExcludes: mssql.SchemaCompareObjectId[] = this.convertExcludesToObjectIds(this.originalSourceExcludes);
let targetExcludes: mssql.SchemaCompareObjectId[] = this.convertExcludesToObjectIds(this.originalTargetExcludes);
let startTime = Date.now();
Telemetry.sendTelemetryEvent('SchemaCompareSaveScmp');
@@ -988,9 +989,9 @@ export class SchemaCompareMainWindow {
/**
* Converts excluded diff entries into object ids which are needed to save them in an scmp
*/
private convertExcludesToObjectIds(excludedDiffEntries: Map<string, azdata.DiffEntry>): azdata.SchemaCompareObjectId[] {
private convertExcludesToObjectIds(excludedDiffEntries: Map<string, mssql.DiffEntry>): mssql.SchemaCompareObjectId[] {
let result = [];
excludedDiffEntries.forEach((value: azdata.DiffEntry) => {
excludedDiffEntries.forEach((value: mssql.DiffEntry) => {
result.push({
nameParts: value.sourceValue ? value.sourceValue : value.targetValue,
sqlObjectType: `Microsoft.Data.Tools.Schema.Sql.SchemaModel.${value.name}`
@@ -1002,7 +1003,7 @@ export class SchemaCompareMainWindow {
private setButtonStatesForNoChanges(enableButtons: boolean): void {
// generate script and apply can only be enabled if the target is a database
if (this.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (this.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Database) {
this.applyButton.enabled = enableButtons;
this.generateScriptButton.enabled = enableButtons;
this.applyButton.title = enableButtons ? applyEnabledMessage : applyNoChangesMessage;
@@ -1010,8 +1011,8 @@ export class SchemaCompareMainWindow {
}
}
private static async getService(providerName: string): Promise<azdata.SchemaCompareServicesProvider> {
let service = azdata.dataprotocol.getProvider<azdata.SchemaCompareServicesProvider>(providerName, azdata.DataProviderType.SchemaCompareServicesProvider);
private static async getService(providerName: string): Promise<mssql.ISchemaCompareService> {
let service = (vscode.extensions.getExtension(mssql.extension.name).exports as mssql.mssql).schemaCompare;
return service;
}

View File

@@ -7,6 +7,7 @@
import * as should from 'should';
import * as azdata from 'azdata';
import * as mssql from '../../../mssql';
import 'mocha';
import { SchemaCompareDialog } from './../dialogs/schemaCompareDialog';
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
@@ -32,8 +33,8 @@ const mockConnectionProfile: azdata.IConnectionProfile = {
const mocksource: string = 'source.dacpac';
const mocktarget: string = 'target.dacpac';
const mockSourceEndpoint: azdata.SchemaCompareEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
const mockSourceEndpoint: mssql.SchemaCompareEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -42,8 +43,8 @@ const mockSourceEndpoint: azdata.SchemaCompareEndpointInfo = {
connectionDetails: undefined
};
const mockTargetEndpoint: azdata.SchemaCompareEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
const mockTargetEndpoint: mssql.SchemaCompareEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -67,7 +68,6 @@ describe('SchemaCompareDialog.openDialog', function (): void {
describe('SchemaCompareResult.start', function (): void {
it('Should be correct when created.', async function (): Promise<void> {
let sc = new SchemaCompareTestService();
azdata.dataprotocol.registerSchemaCompareServicesProvider(sc);
let result = new SchemaCompareMainWindow();
await result.start(null);

View File

@@ -4,8 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as mssql from '../../../mssql';
export class SchemaCompareTestService implements azdata.SchemaCompareServicesProvider {
export class SchemaCompareTestService implements mssql.ISchemaCompareService {
testOperationId: string = 'Test Operation Id';
@@ -13,8 +14,8 @@ export class SchemaCompareTestService implements azdata.SchemaCompareServicesPro
throw new Error('Method not implemented.');
}
schemaCompareGetDefaultOptions(): Thenable<azdata.SchemaCompareOptionsResult> {
let result: azdata.SchemaCompareOptionsResult = {
schemaCompareGetDefaultOptions(): Thenable<mssql.SchemaCompareOptionsResult> {
let result: mssql.SchemaCompareOptionsResult = {
defaultDeploymentOptions: undefined,
success: true,
errorMessage: ''
@@ -23,21 +24,21 @@ export class SchemaCompareTestService implements azdata.SchemaCompareServicesPro
return Promise.resolve(result);
}
schemaCompareIncludeExcludeNode(operationId: string, diffEntry: azdata.DiffEntry, IncludeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
schemaCompareIncludeExcludeNode(operationId: string, diffEntry: mssql.DiffEntry, IncludeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
throw new Error('Method not implemented.');
}
schemaCompareOpenScmp(filePath: string): Thenable<azdata.SchemaCompareOpenScmpResult> {
schemaCompareOpenScmp(filePath: string): Thenable<mssql.SchemaCompareOpenScmpResult> {
throw new Error('Method not implemented.');
}
schemaCompareSaveScmp(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions, scmpFilePath: string, excludedSourceObjects: azdata.SchemaCompareObjectId[], excludedTargetObjects: azdata.SchemaCompareObjectId[]): Thenable<azdata.ResultStatus> {
schemaCompareSaveScmp(sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, targetEndpointInfo: mssql.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: mssql.DeploymentOptions, scmpFilePath: string, excludedSourceObjects: mssql.SchemaCompareObjectId[], excludedTargetObjects: mssql.SchemaCompareObjectId[]): Thenable<azdata.ResultStatus> {
throw new Error('Method not implemented.');
}
schemaCompare(operationId: string, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> {
let result: azdata.SchemaCompareResult = {
schemaCompare(operationId: string, sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, targetEndpointInfo: mssql.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<mssql.SchemaCompareResult> {
let result: mssql.SchemaCompareResult = {
operationId: this.testOperationId,
areEqual: true,
differences: [],

View File

@@ -5,6 +5,7 @@
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as mssql from '../../mssql';
export interface IPackageInfo {
name: string;
@@ -39,12 +40,12 @@ export function getTelemetryErrorType(msg: string): string {
* Return the appropriate endpoint name depending on if the endpoint is a dacpac or a database
* @param endpoint endpoint to get the name of
*/
export function getEndpointName(endpoint: azdata.SchemaCompareEndpointInfo): string {
export function getEndpointName(endpoint: mssql.SchemaCompareEndpointInfo): string {
if (!endpoint) {
return ' ';
}
if (endpoint.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (endpoint.endpointType === mssql.SchemaCompareEndpointType.Database) {
if (!endpoint.serverName && endpoint.connectionDetails) {
endpoint.serverName = endpoint.connectionDetails['serverName'];
}
@@ -72,8 +73,8 @@ function connectionInfoToConnectionProfile(details: azdata.ConnectionInfo): azda
};
}
export async function verifyConnectionAndGetOwnerUri(endpoint: azdata.SchemaCompareEndpointInfo): Promise<string> {
if (endpoint.endpointType === azdata.SchemaCompareEndpointType.Database && endpoint.connectionDetails) {
export async function verifyConnectionAndGetOwnerUri(endpoint: mssql.SchemaCompareEndpointInfo): Promise<string> {
if (endpoint.endpointType === mssql.SchemaCompareEndpointType.Database && endpoint.connectionDetails) {
let connection = await azdata.connection.connect(connectionInfoToConnectionProfile(endpoint.connectionDetails), false, false);
// show error message if the can't connect to the database
@@ -83,4 +84,4 @@ export async function verifyConnectionAndGetOwnerUri(endpoint: azdata.SchemaComp
return await azdata.connection.getUriForConnection(connection.connectionId);
}
return undefined;
}
}