Apply changes from Remote Database to sqlproj - mssql changes (#17655)

* update project from database

* update project from database

* update project from database

* Re-adding schemaComparePublishChanges for temporary backcompat

* Adding comment for keeping enum values in sync

* Correcting enum value

Co-authored-by: Noureldine Yehia <t-nyehia@microsoft.com>
This commit is contained in:
Benjin Dubishar
2021-11-15 15:42:56 -08:00
committed by GitHub
parent d6159a2370
commit b5f8e81250
8 changed files with 163 additions and 19 deletions

View File

@@ -104,7 +104,11 @@ export class SchemaCompareMainWindow {
ownerUri: ownerUri,
packageFilePath: '',
connectionDetails: undefined,
connectionName: profile.connectionName
connectionName: profile.connectionName,
projectFilePath: '',
folderStructure: '',
targetScripts: [],
dataSchemaProvider: ''
};
} else if (sourceDacpac) {
this.sourceEndpointInfo = {
@@ -114,7 +118,11 @@ export class SchemaCompareMainWindow {
databaseName: '',
ownerUri: '',
packageFilePath: sourceDacpac,
connectionDetails: undefined
connectionDetails: undefined,
projectFilePath: '',
folderStructure: '',
targetScripts: [],
dataSchemaProvider: ''
};
}
@@ -776,7 +784,7 @@ export class SchemaCompareMainWindow {
// disable apply and generate script buttons because the results are no longer valid after applying the changes
this.setButtonsForRecompare();
const service = await this.getService();
const service: mssql.ISchemaCompareService = await this.getService();
const result = await service.schemaComparePublishChanges(this.comparisonResult.operationId, this.targetEndpointInfo.serverName, this.targetEndpointInfo.databaseName, azdata.TaskExecutionMode.execute);
if (!result || !result.success) {
TelemetryReporter.createErrorEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareApplyFailed', undefined, getTelemetryErrorType(result.errorMessage))