mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
SYNC: Added option to dump CREATE/DROP database in mysql dump #1103
This commit is contained in:
@@ -253,7 +253,14 @@ const mysqlDriverBase = {
|
|||||||
const customArgs = options.customArgs.split(/\s+/).filter(arg => arg.trim() != '');
|
const customArgs = options.customArgs.split(/\s+/).filter(arg => arg.trim() != '');
|
||||||
args.push(...customArgs);
|
args.push(...customArgs);
|
||||||
}
|
}
|
||||||
|
if (options.createDatabase) {
|
||||||
|
args.push('--databases', database);
|
||||||
|
if (options.dropDatabase) {
|
||||||
|
args.push('--add-drop-database');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
args.push(database);
|
args.push(database);
|
||||||
|
}
|
||||||
return { command, args };
|
return { command, args };
|
||||||
},
|
},
|
||||||
restoreDatabaseCommand(connection, settings, externalTools) {
|
restoreDatabaseCommand(connection, settings, externalTools) {
|
||||||
@@ -346,6 +353,19 @@ const mysqlDriverBase = {
|
|||||||
default: false,
|
default: false,
|
||||||
disabledFn: values => values.lockTables || values.skipLockTables,
|
disabledFn: values => values.lockTables || values.skipLockTables,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'checkbox',
|
||||||
|
label: 'Create database',
|
||||||
|
name: 'createDatabase',
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'checkbox',
|
||||||
|
label: 'Drop database before import',
|
||||||
|
name: 'dropDatabase',
|
||||||
|
default: false,
|
||||||
|
disabledFn: values => !values.createDatabase,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: 'Custom arguments',
|
label: 'Custom arguments',
|
||||||
|
|||||||
Reference in New Issue
Block a user