mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user