mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Check provider type before throwing error message on cloud servers (#5948)
* check provider type in backup action * check provider name in case of restore as well * removed harcoding of constant
This commit is contained in:
@@ -26,6 +26,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
|
||||
|
||||
export interface BaseActionContext {
|
||||
object?: ObjectMetadata;
|
||||
@@ -253,7 +254,7 @@ export class BackupAction extends Task {
|
||||
}
|
||||
if (profile) {
|
||||
const serverInfo = connectionManagementService.getServerInfo(profile.id);
|
||||
if (serverInfo && serverInfo.isCloud) {
|
||||
if (serverInfo && serverInfo.isCloud && profile.providerName === mssqlProviderName) {
|
||||
return accessor.get<INotificationService>(INotificationService).info(nls.localize('backup.commandNotSupported', 'Backup command is not supported for Azure SQL databases.'));
|
||||
}
|
||||
}
|
||||
@@ -296,7 +297,7 @@ export class RestoreAction extends Task {
|
||||
}
|
||||
if (profile) {
|
||||
const serverInfo = connectionManagementService.getServerInfo(profile.id);
|
||||
if (serverInfo && serverInfo.isCloud) {
|
||||
if (serverInfo && serverInfo.isCloud && profile.providerName === mssqlProviderName) {
|
||||
return accessor.get<INotificationService>(INotificationService).info(nls.localize('restore.commandNotSupported', 'Restore command is not supported for Azure SQL databases.'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user