mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
fix compare after opening scmp with dacpacs failing (#6201)
This commit is contained in:
@@ -177,7 +177,7 @@ export class SchemaCompareDialog {
|
|||||||
private endpointChanged(previousEndpoint: azdata.SchemaCompareEndpointInfo, updatedEndpoint: azdata.SchemaCompareEndpointInfo): boolean {
|
private endpointChanged(previousEndpoint: azdata.SchemaCompareEndpointInfo, updatedEndpoint: azdata.SchemaCompareEndpointInfo): boolean {
|
||||||
if (previousEndpoint && updatedEndpoint) {
|
if (previousEndpoint && updatedEndpoint) {
|
||||||
return getEndpointName(previousEndpoint).toLowerCase() !== getEndpointName(updatedEndpoint).toLowerCase()
|
return getEndpointName(previousEndpoint).toLowerCase() !== getEndpointName(updatedEndpoint).toLowerCase()
|
||||||
|| previousEndpoint.serverDisplayName.toLocaleLowerCase() !== updatedEndpoint.serverDisplayName.toLowerCase();
|
|| (previousEndpoint.serverDisplayName && updatedEndpoint.serverDisplayName && previousEndpoint.serverDisplayName.toLowerCase() !== updatedEndpoint.serverDisplayName.toLowerCase());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -541,9 +541,6 @@ export class SchemaCompareDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let finalName = `${srv} (${usr})`;
|
let finalName = `${srv} (${usr})`;
|
||||||
if (endpointInfo) {
|
|
||||||
console.error('finalname: ' + finalName + ' endpointname: ' + endpointInfo.serverDisplayName);
|
|
||||||
}
|
|
||||||
// use previously selected server or current connection if there is one
|
// use previously selected server or current connection if there is one
|
||||||
if (endpointInfo && !isNullOrUndefined(endpointInfo.serverName) && !isNullOrUndefined(endpointInfo.serverDisplayName)
|
if (endpointInfo && !isNullOrUndefined(endpointInfo.serverName) && !isNullOrUndefined(endpointInfo.serverDisplayName)
|
||||||
&& c.options.server.toLowerCase() === endpointInfo.serverName.toLowerCase()
|
&& c.options.server.toLowerCase() === endpointInfo.serverName.toLowerCase()
|
||||||
|
|||||||
@@ -880,7 +880,16 @@ export class SchemaCompareResult {
|
|||||||
this.sourceEndpointInfo.ownerUri = ownerUri;
|
this.sourceEndpointInfo.ownerUri = ownerUri;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.sourceEndpointInfo = result.sourceEndpointInfo;
|
// 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,
|
||||||
|
serverDisplayName: '',
|
||||||
|
serverName: '',
|
||||||
|
databaseName: '',
|
||||||
|
ownerUri: '',
|
||||||
|
packageFilePath: result.sourceEndpointInfo.packageFilePath,
|
||||||
|
connectionDetails: undefined
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.targetEndpointInfo && result.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
|
if (result.targetEndpointInfo && result.targetEndpointInfo.endpointType === azdata.SchemaCompareEndpointType.Database) {
|
||||||
@@ -890,7 +899,16 @@ export class SchemaCompareResult {
|
|||||||
this.targetEndpointInfo.ownerUri = ownerUri;
|
this.targetEndpointInfo.ownerUri = ownerUri;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.targetEndpointInfo = result.targetEndpointInfo;
|
// 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,
|
||||||
|
serverDisplayName: '',
|
||||||
|
serverName: '',
|
||||||
|
databaseName: '',
|
||||||
|
ownerUri: '',
|
||||||
|
packageFilePath: result.targetEndpointInfo.packageFilePath,
|
||||||
|
connectionDetails: undefined
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateSourceAndTarget();
|
this.updateSourceAndTarget();
|
||||||
|
|||||||
Reference in New Issue
Block a user