mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
[SQL-Migration] collation errorcode (#21797)
This commit is contained in:
@@ -44,6 +44,11 @@ export const LoginMigrationStatusCodes = {
|
|||||||
Failed: 'Failed',
|
Failed: 'Failed',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ValidationErrorCodes = {
|
||||||
|
// TODO: adding other error codes for troubleshooting
|
||||||
|
SqlInfoValidationFailed: '2056'
|
||||||
|
};
|
||||||
|
|
||||||
const _dateFormatter = new Intl.DateTimeFormat(
|
const _dateFormatter = new Intl.DateTimeFormat(
|
||||||
undefined, {
|
undefined, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
|
|||||||
@@ -408,9 +408,10 @@ export function SQL_TARGET_CONNECTION_DUPLICATE_TARGET_MAPPING(
|
|||||||
): string {
|
): string {
|
||||||
return localize(
|
return localize(
|
||||||
'sql.migration.wizard.target.mapping.error.duplicate',
|
'sql.migration.wizard.target.mapping.error.duplicate',
|
||||||
"Database mapping error. Target database '{0}' cannot be selected to as a migration target for database '{1}'. Target database '${targetDatabaseName}' is already selected as a migration target for database '{2}'. Please select a different target database.",
|
"Database mapping error. Target database '{0}' cannot be selected to as a migration target for database '{1}'. Target database '{2}' is already selected as a migration target for database '{3}'. Please select a different target database.",
|
||||||
targetDatabaseName,
|
targetDatabaseName,
|
||||||
sourceDatabaseName,
|
sourceDatabaseName,
|
||||||
|
targetDatabaseName,
|
||||||
mappedSourceDatabaseName);
|
mappedSourceDatabaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,19 +419,21 @@ export function SQL_TARGET_CONNECTION_DUPLICATE_TARGET_MAPPING(
|
|||||||
export function SQL_TARGET_CONNECTION_SOURCE_NOT_MAPPED(sourceDatabaseName: string): string {
|
export function SQL_TARGET_CONNECTION_SOURCE_NOT_MAPPED(sourceDatabaseName: string): string {
|
||||||
return localize(
|
return localize(
|
||||||
'sql.migration.wizard.target.source.mapping.error',
|
'sql.migration.wizard.target.source.mapping.error',
|
||||||
"Database mapping error. Source database '{0}' is not mapped to a target database. Please select a target database to migrate to.",
|
"Database mapping error. Source database '{0}' is not mapped to a target database. Please select a target database to migrate to.",
|
||||||
sourceDatabaseName);
|
sourceDatabaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//`Database mapping error. Source database ({0}) collation ({1}) does not match target database ({2}) collation ({3}). Please select a target database with the same collation to the source database.`
|
//`A mapping error (Error code: {0}) was found between '{1}' and '{2}' databases. The source database collation '{3}' does not match the target database collation '{4}'. Please select or re-create a target database with the same collation as the source database.`
|
||||||
export function SQL_TARGET_SOURCE_COLLATION_NOT_SAME(
|
export function SQL_TARGET_SOURCE_COLLATION_NOT_SAME(
|
||||||
|
errorCode: string,
|
||||||
sourceDatabaseName: string,
|
sourceDatabaseName: string,
|
||||||
targetDatabaseName: string,
|
targetDatabaseName: string,
|
||||||
sourceDatabaseCollation: string | undefined,
|
sourceDatabaseCollation: string | undefined,
|
||||||
targetDatabaseCollation: string | undefined): string {
|
targetDatabaseCollation: string | undefined): string {
|
||||||
return localize(
|
return localize(
|
||||||
'sql.migration.wizard.target.source.collation.error',
|
'sql.migration.wizard.target.source.collation.error',
|
||||||
"A mapping error was found between '{0}' and '{1}' databases. The source database collation '{2}' does not match the target database collation '{3}'. Please select or re-create a target database with the same collation as the source database.",
|
"Database mapping error (Error code: {0}) was found between '{1}' and '{2}' databases. The source database collation '{3}' does not match the target database collation '{4}'. Please select or re-create a target database with the same collation as the source database.",
|
||||||
|
errorCode,
|
||||||
sourceDatabaseName,
|
sourceDatabaseName,
|
||||||
targetDatabaseName,
|
targetDatabaseName,
|
||||||
sourceDatabaseCollation,
|
sourceDatabaseCollation,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { AzureSqlDatabaseServer, getVMInstanceView, SqlVMServer } from '../api/a
|
|||||||
import { collectTargetDatabaseInfo, TargetDatabaseInfo } from '../api/sqlUtils';
|
import { collectTargetDatabaseInfo, TargetDatabaseInfo } from '../api/sqlUtils';
|
||||||
import { MigrationLocalStorage, MigrationServiceContext } from '../models/migrationLocalStorage';
|
import { MigrationLocalStorage, MigrationServiceContext } from '../models/migrationLocalStorage';
|
||||||
import { TdeMigrationDialog } from '../dialog/tdeConfiguration/tdeMigrationDialog';
|
import { TdeMigrationDialog } from '../dialog/tdeConfiguration/tdeMigrationDialog';
|
||||||
|
import { ValidationErrorCodes } from '../constants/helper';
|
||||||
|
|
||||||
const TDE_MIGRATION_BUTTON_INDEX = 1;
|
const TDE_MIGRATION_BUTTON_INDEX = 1;
|
||||||
|
|
||||||
@@ -1167,6 +1168,7 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
if (!this._isCollationSame(sourceDatabaseCollation, targetDatabaseCollation)) {
|
if (!this._isCollationSame(sourceDatabaseCollation, targetDatabaseCollation)) {
|
||||||
collationErrors.push(
|
collationErrors.push(
|
||||||
constants.SQL_TARGET_SOURCE_COLLATION_NOT_SAME(
|
constants.SQL_TARGET_SOURCE_COLLATION_NOT_SAME(
|
||||||
|
ValidationErrorCodes.SqlInfoValidationFailed,
|
||||||
sourceDatabaseName,
|
sourceDatabaseName,
|
||||||
targetDatabaseName,
|
targetDatabaseName,
|
||||||
sourceDatabaseCollation,
|
sourceDatabaseCollation,
|
||||||
|
|||||||
Reference in New Issue
Block a user