Add sql proj schema compare for dacpac (#10388)

* add support for schema compare to specify source dacpac

* add build and dacpac produced from build

* check if dacpac exists

* add tests

* move exists check code to utils

* fix test run failing
This commit is contained in:
Kim Santiago
2020-05-15 13:03:08 -07:00
committed by GitHub
parent ef4ab4a59f
commit b83279c24c
7 changed files with 97 additions and 1 deletions

View File

@@ -77,9 +77,14 @@ export class SchemaCompareMainWindow {
this.editor = azdata.workspace.createModelViewEditor(loc.SchemaCompareLabel, { retainContextWhenHidden: true, supportsSave: true, resourceName: schemaCompareResourceName });
}
// schema compare can get started with three contexts for the source:
// 1. undefined
// 2. connection profile
// 3. dacpac
public async start(context: any) {
// if schema compare was launched from a db, set that as the source
let profile = context ? <azdata.IConnectionProfile>context.connectionProfile : undefined;
let sourceDacpac = context as string;
if (profile) {
let ownerUri = await azdata.connection.getUriForConnection((profile.id));
this.sourceEndpointInfo = {
@@ -91,6 +96,16 @@ export class SchemaCompareMainWindow {
packageFilePath: '',
connectionDetails: undefined
};
} else if (sourceDacpac) {
this.sourceEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
ownerUri: '',
packageFilePath: sourceDacpac,
connectionDetails: undefined
};
}
this.editor.registerContent(async view => {