mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
Updating assessment api response object in SQL Migration (#16334)
* Modifying the get assessments api to match the new specs * fixing property name * Updating sts version
This commit is contained in:
@@ -176,30 +176,17 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
const assessmentResults = await this.migrationService.getAssessments(
|
||||
ownerUri
|
||||
);
|
||||
|
||||
this._serverDatabases = await (await azdata.connection.listDatabases(this.sourceConnectionId)).filter((name) => !excludeDbs.includes(name));
|
||||
const serverLevelAssessments: mssql.SqlMigrationAssessmentResultItem[] = [];
|
||||
const databaseLevelAssessments = this._serverDatabases.map(db => {
|
||||
const dbAssessments = assessmentResults?.assessmentResult.databases.filter(d => !excludeDbs.includes(d.name)).map(d => {
|
||||
return {
|
||||
name: db,
|
||||
issues: <mssql.SqlMigrationAssessmentResultItem[]>[]
|
||||
name: d.name,
|
||||
issues: d.items.filter(i => i.appliesToMigrationTargetPlatform === MigrationTargetType.SQLMI) ?? []
|
||||
};
|
||||
});
|
||||
|
||||
assessmentResults?.items.forEach((item) => {
|
||||
if (item.appliesToMigrationTargetPlatform === MigrationTargetType.SQLMI) {
|
||||
const dbIndex = this._serverDatabases.indexOf(item.databaseName);
|
||||
if (dbIndex === -1) {
|
||||
serverLevelAssessments.push(item);
|
||||
} else {
|
||||
databaseLevelAssessments[dbIndex].issues.push(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this._assessmentResults = {
|
||||
issues: serverLevelAssessments,
|
||||
databaseAssessments: databaseLevelAssessments
|
||||
issues: assessmentResults?.assessmentResult.items?.filter(i => i.appliesToMigrationTargetPlatform === MigrationTargetType.SQLMI) ?? [],
|
||||
databaseAssessments: dbAssessments! ?? []
|
||||
};
|
||||
|
||||
return this._assessmentResults;
|
||||
|
||||
Reference in New Issue
Block a user