mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support to drop databases using the 'WITH (FORCE)' option. #6367
This commit is contained in:
@@ -39,8 +39,6 @@ _.extend(pgBrowser.keyboardNavigation, {
|
||||
'sub_menu_refresh': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'sub_menu_refresh').value),
|
||||
'context_menu': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'context_menu').value),
|
||||
'direct_debugging': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'direct_debugging').value),
|
||||
'drop_multiple_objects': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'grid_menu_drop_multiple').value),
|
||||
'drop_cascade_multiple_objects': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'grid_menu_drop_cascade_multiple').value),
|
||||
'add_grid_row': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'add_grid_row').value),
|
||||
'open_quick_search': commonUtils.parseShortcutValue(pgBrowser.get_preference('browser', 'open_quick_search').value),
|
||||
|
||||
@@ -62,8 +60,6 @@ _.extend(pgBrowser.keyboardNavigation, {
|
||||
'bindSubMenuRefresh': {'shortcuts': this.keyboardShortcut.sub_menu_refresh, 'bindElem': '#tree'}, // Sub menu - Refresh object,
|
||||
'bindContextMenu': {'shortcuts': this.keyboardShortcut.context_menu}, // Sub menu - Open context menu,
|
||||
'bindDirectDebugging': {'shortcuts': this.keyboardShortcut.direct_debugging}, // Sub menu - Direct Debugging
|
||||
'bindDropMultipleObjects': {'shortcuts': this.keyboardShortcut.drop_multiple_objects}, // Grid Menu Drop Multiple
|
||||
'bindDropCascadeMultipleObjects': {'shortcuts': this.keyboardShortcut.drop_cascade_multiple_objects}, // Grid Menu Drop Cascade Multiple
|
||||
'bindAddGridRow': {'shortcuts': this.keyboardShortcut.add_grid_row}, // Subnode Grid Add Row
|
||||
'bindOpenQuickSearch': {'shortcuts': this.keyboardShortcut.open_quick_search}, // Subnode Grid Refresh Row
|
||||
};
|
||||
|
||||
@@ -144,7 +144,7 @@ define('pgadmin.browser.node', [
|
||||
applies: ['object', 'context'],
|
||||
callback: 'delete_obj',
|
||||
priority: self.dropPriority,
|
||||
label: (self.dropAsRemove) ? gettext('Remove %s', self.label) : gettext('Delete/Drop'),
|
||||
label: (self.dropAsRemove) ? gettext('Remove %s', self.label) : gettext('Delete'),
|
||||
data: {
|
||||
'url': 'drop',
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
@@ -162,8 +162,8 @@ define('pgadmin.browser.node', [
|
||||
module: self,
|
||||
applies: ['object', 'context'],
|
||||
callback: 'delete_obj',
|
||||
priority: 3,
|
||||
label: gettext('Drop Cascade'),
|
||||
priority: 2,
|
||||
label: gettext('Delete (Cascade)'),
|
||||
data: {
|
||||
'url': 'delete',
|
||||
},
|
||||
@@ -657,11 +657,14 @@ define('pgadmin.browser.node', [
|
||||
|
||||
let msg, title;
|
||||
|
||||
if (input.url == 'delete') {
|
||||
if (input.url == 'delete' && d._type === 'database') {
|
||||
msg = gettext('Delete database with the force option will attempt to terminate all existing connections to the "%s" database. Are you sure you want to proceed?', d.label);
|
||||
title = gettext('Delete FORCE %s?', obj.label);
|
||||
|
||||
msg = gettext('Are you sure you want to drop %s "%s" and all the objects that depend on it?',
|
||||
} else if (input.url == 'delete') {
|
||||
msg = gettext('Are you sure you want to delete %s "%s" and all the objects that depend on it?',
|
||||
obj.label.toLowerCase(), d.label);
|
||||
title = gettext('DROP CASCADE %s?', obj.label);
|
||||
title = gettext('Delete CASCADE %s?', obj.label);
|
||||
|
||||
if (!(_.isFunction(obj.canDropCascade) ?
|
||||
obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) {
|
||||
@@ -676,8 +679,8 @@ define('pgadmin.browser.node', [
|
||||
msg = gettext('Are you sure you want to remove %s "%s"?', obj.label.toLowerCase(), d.label);
|
||||
title = gettext('Remove %s?', obj.label);
|
||||
} else {
|
||||
msg = gettext('Are you sure you want to drop %s "%s"?', obj.label.toLowerCase(), d.label);
|
||||
title = gettext('Drop %s?', obj.label);
|
||||
msg = gettext('Are you sure you want to delete %s "%s"?', obj.label.toLowerCase(), d.label);
|
||||
title = gettext('Delete %s?', obj.label);
|
||||
}
|
||||
|
||||
if (!(_.isFunction(obj.canDrop) ?
|
||||
|
||||
Reference in New Issue
Block a user