mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 17:24:01 -05:00
Retry sql migration (#17376)
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { MigrationContext } from '../models/migrationLocalStorage';
|
||||
import { MigrationContext, MigrationStatus } from '../models/migrationLocalStorage';
|
||||
import { MigrationMode, MigrationTargetType } from '../models/stateMachine';
|
||||
import * as loc from './strings';
|
||||
|
||||
export enum SQLTargetAssetType {
|
||||
@@ -22,6 +23,28 @@ export function getMigrationTargetType(migration: MigrationContext): string {
|
||||
}
|
||||
}
|
||||
|
||||
export function getMigrationMode(migration: MigrationContext): string {
|
||||
return migration.migrationContext.properties.offlineConfiguration?.offline?.valueOf() ? loc.OFFLINE : loc.OFFLINE;
|
||||
export function getMigrationTargetTypeEnum(migration: MigrationContext): MigrationTargetType | undefined {
|
||||
switch (migration.targetManagedInstance.type) {
|
||||
case SQLTargetAssetType.SQLMI:
|
||||
return MigrationTargetType.SQLMI;
|
||||
case SQLTargetAssetType.SQLVM:
|
||||
return MigrationTargetType.SQLVM;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function getMigrationMode(migration: MigrationContext): string {
|
||||
return migration.migrationContext.properties.offlineConfiguration?.offline?.valueOf() ? loc.OFFLINE : loc.ONLINE;
|
||||
}
|
||||
|
||||
export function getMigrationModeEnum(migration: MigrationContext): MigrationMode {
|
||||
return migration.migrationContext.properties.offlineConfiguration?.offline?.valueOf() ? MigrationMode.OFFLINE : MigrationMode.ONLINE;
|
||||
}
|
||||
|
||||
export function canRetryMigration(status: string | undefined): boolean {
|
||||
return status === undefined ||
|
||||
status === MigrationStatus.Failed ||
|
||||
status === MigrationStatus.Succeeded ||
|
||||
status === MigrationStatus.Canceled;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ export class IconPathHelper {
|
||||
public static newSupportRequest: IconPath;
|
||||
public static emptyTable: IconPath;
|
||||
public static addAzureAccount: IconPath;
|
||||
public static retry: IconPath;
|
||||
|
||||
public static setExtensionContext(context: vscode.ExtensionContext) {
|
||||
IconPathHelper.copy = {
|
||||
@@ -153,5 +154,9 @@ export class IconPathHelper {
|
||||
light: context.asAbsolutePath('images/noAzureAccount.svg'),
|
||||
dark: context.asAbsolutePath('images/noAzureAccount.svg')
|
||||
};
|
||||
IconPathHelper.retry = {
|
||||
light: context.asAbsolutePath('images/retry.svg'),
|
||||
dark: context.asAbsolutePath('images/retry.svg')
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +537,14 @@ export const AUTHENTICATION_TYPE = localize('sql.migration.authentication.type',
|
||||
export const REFRESH_BUTTON_LABEL = localize('sql.migration.status.refresh.label', 'Refresh');
|
||||
|
||||
// Saved Assessment Dialog
|
||||
|
||||
export const NEXT_LABEL = localize('sql.migration.saved.assessment.next', "Next");
|
||||
export const CANCEL_LABEL = localize('sql.migration.saved.assessment.cancel', "Cancel");
|
||||
export const SAVED_ASSESSMENT_RESULT = localize('sql.migration.saved.assessment.result', "Saved assessment result");
|
||||
|
||||
// Retry Migration
|
||||
export const MIGRATION_CANNOT_RETRY = localize('sql.migration.cannot.retry', 'Migration cannot be retried.');
|
||||
export const RETRY_MIGRATION = localize('sql.migration.retry.migration', "Retry migration");
|
||||
export const MIGRATION_RETRY_ERROR = localize('sql.migration.retry.migration.error', 'An error occurred while retrying the migration.');
|
||||
|
||||
export const INVALID_OWNER_URI = localize('sql.migration.invalid.owner.uri.error', 'Cannot connect to the database due to invalid OwnerUri (Parameter \'OwnerUri\')');
|
||||
export const DATABASE_BACKUP_PAGE_LOAD_ERROR = localize('sql.migration.database.backup.load.error', 'An error occurred while accessing database details.');
|
||||
|
||||
Reference in New Issue
Block a user