Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crm-16541 Allow extra options to be passed to mysqldump. #520

Merged
merged 1 commit into from
Feb 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions drush/civicrm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,14 @@ function civicrm_drush_command() {
'description' => 'Exports the CiviCRM DB as SQL using mysqldump.',
'examples' => array(
'drush civicrm-sql-dump --result-file=../CiviCRM.sql' => 'Save SQL dump to the directory above Drupal root.',
'drush civicrm-sql-dump --extra-options=--quick' => 'Pass the --quick option to mysqldump to help with large tables.',
),
'options' => array(
'data-only' => 'Dump data without statements to create any of the schema.',
'gzip' => 'Compress the dump using the gzip program which must be in your $PATH.',
'result-file' => 'Save to a file.',
'tables-list' => 'comma-separated list of tables to transfer.',
'extra-options' => 'Add custom options to the dump command.',
),
);
$items['civicrm-sql-query'] = array(
Expand Down Expand Up @@ -1177,6 +1179,8 @@ function drush_civicrm_pre_civicrm_sqldump() {
* Implementation of command 'civicrm-sql-dump'
*/
function drush_civicrm_sqldump() {
$extra_options = drush_get_option('extra-options', '');
drush_set_option('extra', '--routines ' . $extra_options);
if (version_compare(DRUSH_VERSION, 7, '>=')) {
drush_sql_dump();
}
Expand Down