Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #48 from meanbee/40-add-routines-flag
Browse files Browse the repository at this point in the history
Fixed #40: Add ability to declare routines and triggers in export.
  • Loading branch information
bobbyshaw authored Feb 15, 2017
2 parents 84c4a7a + f304559 commit 91d3b01
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Meanbee/Magedbm/Command/PutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ protected function configure()
InputOption::VALUE_OPTIONAL,
'Tables to exclude from export. Default is magerun\'s @development option.'
)
->addOption(
'--routines',
'-R',
InputOption::VALUE_NONE,
'Include stored procedures and functions in the export'
)
->addOption(
'--triggers',
'-T',
InputOption::VALUE_NONE,
'Include triggers in the export'
)
->addOption(
'--no-clean',
null,
Expand Down Expand Up @@ -213,6 +225,8 @@ private function createBackup(InputInterface $input, OutputInterface $output)
$filePath = $this->getFilePath($input);

$stripOptions = $input->getOption('strip') ?: '@development';
$routines = $input->getOption('routines') ?: false;
$triggers = $input->getOption('triggers') ?: false;

// Exec must be unavailable so use PHP alternative (match output)
$dbHelper = new DatabaseHelper();
Expand Down Expand Up @@ -260,7 +274,8 @@ private function createBackup(InputInterface $input, OutputInterface $output)
'include-tables' => $stripTables,
'no-data' => true,
'add-drop-table' => true,
'skip-triggers' => true,
'routines' => $routines,
'skip-triggers' => !$triggers,
)
);

Expand Down

0 comments on commit 91d3b01

Please sign in to comment.