mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support for excluding multiple tables while taking Backup. #7163
This commit is contained in:
@@ -327,6 +327,7 @@ def _get_args_params_values(data, conn, backup_obj_type, backup_file, server,
|
||||
set_value('exclude_table_data_and_children',
|
||||
'--exclude-table-data-and-children', None,
|
||||
manager.version >= 160000)
|
||||
set_value('exclude_table', '--exclude-table')
|
||||
|
||||
# Disable options
|
||||
set_param('disable_trigger', '--disable-triggers',
|
||||
|
||||
@@ -658,13 +658,6 @@ export default class BackupSchema extends BaseUISchema {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}, {
|
||||
id: 'exclude_table_data',
|
||||
label: gettext('Exclude table data'),
|
||||
type: 'text',
|
||||
disabled: false,
|
||||
group: gettext('Table Options'),
|
||||
visible: isVisibleForServerBackup(obj.backupType)
|
||||
}, {
|
||||
id: 'table_and_children',
|
||||
label: gettext('Table and Children'),
|
||||
@@ -673,6 +666,20 @@ export default class BackupSchema extends BaseUISchema {
|
||||
group: gettext('Table Options'),
|
||||
min_version: 160000,
|
||||
visible: isVisibleForServerBackup(obj.backupType)
|
||||
}, {
|
||||
id: 'exclude_table',
|
||||
label: gettext('Exclude table'),
|
||||
type: 'text',
|
||||
disabled: false,
|
||||
group: gettext('Table Options'),
|
||||
visible: isVisibleForServerBackup(obj.backupType)
|
||||
}, {
|
||||
id: 'exclude_table_data',
|
||||
label: gettext('Exclude table data'),
|
||||
type: 'text',
|
||||
disabled: false,
|
||||
group: gettext('Table Options'),
|
||||
visible: isVisibleForServerBackup(obj.backupType)
|
||||
}, {
|
||||
id: 'exclude_table_and_children',
|
||||
label: gettext('Exclude table and children'),
|
||||
|
||||
@@ -708,6 +708,31 @@ class BackupCreateJobTest(BaseTestGenerator):
|
||||
message='--large-objects is not supported by EPAS/PG server '
|
||||
'less than 16'
|
||||
)),
|
||||
('When backup the object with option - Exclude table',
|
||||
dict(
|
||||
class_params=dict(
|
||||
sid=1,
|
||||
name='test_backup_server',
|
||||
port=5444,
|
||||
host='localhost',
|
||||
database='postgres',
|
||||
bfile='test_backup',
|
||||
username='postgres'
|
||||
),
|
||||
params=dict(
|
||||
file='test_backup_file',
|
||||
format='custom',
|
||||
verbose=True,
|
||||
schemas=[],
|
||||
tables=[],
|
||||
database='postgres',
|
||||
exclude_table="table1"
|
||||
),
|
||||
url=BACKUP_OBJECT_URL,
|
||||
expected_cmd_opts=['--exclude-table', 'table1'],
|
||||
not_expected_cmd_opts=[],
|
||||
expected_exit_code=[0, None]
|
||||
)),
|
||||
('When backup a schema with default options (< v16)',
|
||||
dict(
|
||||
class_params=dict(
|
||||
|
||||
Reference in New Issue
Block a user