From f304559a8e9d671f8f2e704d4cc8f56993da23ca Mon Sep 17 00:00:00 2001 From: Tom Robertshaw Date: Tue, 7 Feb 2017 19:10:02 +0000 Subject: [PATCH] Fixed #40: Add ability to declare routines and triggers in export. --- src/Meanbee/Magedbm/Command/PutCommand.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Meanbee/Magedbm/Command/PutCommand.php b/src/Meanbee/Magedbm/Command/PutCommand.php index 73d45ef..b916c75 100644 --- a/src/Meanbee/Magedbm/Command/PutCommand.php +++ b/src/Meanbee/Magedbm/Command/PutCommand.php @@ -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, @@ -211,6 +223,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(); @@ -258,7 +272,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, ) );