mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 06:46:00 +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() != '');
|
||||
args.push(...customArgs);
|
||||
}
|
||||
args.push(database);
|
||||
if (options.createDatabase) {
|
||||
args.push('--databases', database);
|
||||
if (options.dropDatabase) {
|
||||
args.push('--add-drop-database');
|
||||
}
|
||||
} else {
|
||||
args.push(database);
|
||||
}
|
||||
return { command, args };
|
||||
},
|
||||
restoreDatabaseCommand(connection, settings, externalTools) {
|
||||
@@ -346,6 +353,19 @@ const mysqlDriverBase = {
|
||||
default: false,
|
||||
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',
|
||||
label: 'Custom arguments',
|
||||
|
||||
Reference in New Issue
Block a user