Skip to content

Commit

Permalink
Merge pull request #8 from CakeDC/feature/extend-inserts-optional
Browse files Browse the repository at this point in the history
Let the app create dump using extended inserts
  • Loading branch information
steinkel committed Jan 22, 2021
2 parents 6304795 + c01f2b1 commit 864e041
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Engine/MysqlEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
namespace CakeDC\DbTest\Engine;

use Cake\Core\Configure;
use Cake\Log\Log;

class MysqlEngine extends BaseEngine
Expand Down Expand Up @@ -63,7 +64,11 @@ public function export($file, $options = [])
{
$databaseName = $this->_database['database'];
$baseArgs = $this->_getBaseArguments();
$command = "mysqldump --extended-insert=FALSE $baseArgs $databaseName | grep -v -a '/*!50013 DEFINER'";
$command = "mysqldump";
if (Configure::read('DbTest.dumpExtendedInserts') !== true) {
$command .= " --extended-insert=FALSE";
}
$command .= " $baseArgs $databaseName | grep -v -a '/*!50013 DEFINER'";
if (!empty($file)) {
$command .= " > $file";
}
Expand Down

0 comments on commit 864e041

Please sign in to comment.