mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
add schema migration (#24594)
* add schema migration * fix table selection issue * fix table validation * data only wont show schema info grids * address comments * update schema migration helper banner * fix undefined * refactor * endedOn is - when not started * fix toString * refactor * auto referesh dashboardtab and migrationtab * add migration type in dashboard * fix saving issue in page 0 and page 1 * fix compile issue * fix save and close in page 3 * refactor * fix save * fix save * fix save * dont load location twice * fix target type undefined issue * set MI as default * fix cannot load in step 3 * integrate assessment with schema --------- Co-authored-by: Siyang Yao <siyao@microsoft.com>
This commit is contained in:
@@ -867,6 +867,7 @@ export function getMigrationErrors(migration: DatabaseMigration): string {
|
||||
errors.push(migration.properties.migrationStatusWarnings?.completeRestoreErrorMessage);
|
||||
errors.push(migration.properties.migrationStatusWarnings?.restoreBlockingReason);
|
||||
errors.push(...migration.properties.migrationStatusDetails?.listOfCopyProgressDetails?.flatMap(cp => cp.errors) ?? []);
|
||||
errors.push(...migration.properties.migrationStatusDetails?.sqlSchemaMigrationStatus?.sqlSchemaCopyErrors ?? []);
|
||||
}
|
||||
|
||||
// remove undefined and duplicate error entries
|
||||
@@ -956,6 +957,8 @@ export interface StartDatabaseMigrationRequest {
|
||||
tableList?: string[],
|
||||
scope: string,
|
||||
offlineConfiguration?: OfflineConfiguration,
|
||||
sqlSchemaMigrationConfiguration?: SqlSchemaMigrationConfiguration,
|
||||
sqlDataMigrationConfiguration?: SqlDataMigrationConfiguration
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1082,6 +1085,8 @@ export interface DatabaseMigrationProperties {
|
||||
migrationOperationId: string;
|
||||
backupConfiguration: BackupConfiguration;
|
||||
offlineConfiguration: OfflineConfiguration;
|
||||
sqlSchemaMigrationConfiguration: SqlSchemaMigrationConfiguration;
|
||||
sqlDataMigrationConfiguration: SqlDataMigrationConfiguration;
|
||||
migrationFailureError: ErrorInfo;
|
||||
tableList: string[];
|
||||
}
|
||||
@@ -1103,6 +1108,7 @@ export interface MigrationStatusDetails {
|
||||
invalidFiles: string[];
|
||||
listOfCopyProgressDetails: CopyProgressDetail[];
|
||||
sqlDataCopyErrors: string[];
|
||||
sqlSchemaMigrationStatus: SqlSchemaMigrationStatus;
|
||||
|
||||
// new fields
|
||||
pendingDiffBackupsCount: number;
|
||||
@@ -1142,6 +1148,38 @@ export interface CopyProgressDetail {
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export interface SqlSchemaMigrationStatus {
|
||||
sqlSchemaCopyErrors: string[];
|
||||
status: 'CollectionCompleted' | 'PrefetchObjects' | 'GetDependency' | 'ScriptObjects' | 'ScriptViewIndexes' | 'ScriptOwnership' | 'GeneratingScript' | 'GeneratingScriptCompleted' | 'DeployingSchema' | 'DeploymentCompleted' | 'Completed' | 'CompletedWithError';
|
||||
objectsCollection: ObjectsCollection;
|
||||
scriptGeneration: ScriptGeneration;
|
||||
scriptDeployment: ScriptDeployment;
|
||||
}
|
||||
|
||||
export interface ObjectsCollection {
|
||||
totalCountOfObjectsCollected: number;
|
||||
startedOn: string;
|
||||
endedOn: string;
|
||||
}
|
||||
|
||||
export interface ScriptGeneration {
|
||||
progressInPercentage: string;
|
||||
scriptedObjectsFailedCount: number;
|
||||
scriptedObjectsCount: number;
|
||||
startedOn: string;
|
||||
endedOn: string;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export interface ScriptDeployment {
|
||||
progressInPercentage: string;
|
||||
failedDeploymentCount: number;
|
||||
succeededDeploymentCount: number;
|
||||
startedOn: string;
|
||||
endedOn: string;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export interface BackupConfiguration {
|
||||
sourceLocation?: SourceLocation;
|
||||
targetLocation?: TargetLocation;
|
||||
@@ -1152,6 +1190,14 @@ export interface OfflineConfiguration {
|
||||
lastBackupName?: string;
|
||||
}
|
||||
|
||||
export interface SqlSchemaMigrationConfiguration {
|
||||
enableSchemaMigration: boolean;
|
||||
}
|
||||
|
||||
export interface SqlDataMigrationConfiguration {
|
||||
enableDataMigration: boolean;
|
||||
}
|
||||
|
||||
export interface ErrorInfo {
|
||||
code: string;
|
||||
message: string;
|
||||
|
||||
Reference in New Issue
Block a user