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 #23 from meanbee/19-dump-always-drop-tables
Browse files Browse the repository at this point in the history
Always drop tables when creating database export.
  • Loading branch information
bobbyshaw committed Dec 18, 2015
2 parents 3623ba5 + df40271 commit 8d66951
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/Meanbee/Magedbm/Command/GetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function configure()
'--drop-tables',
'-d',
InputOption::VALUE_NONE,
'Drop tables before import'
'Drop tables before import. Deprecated since 1.4.0 as all exports now drop tables automatically.'
)
->addOption(
'--region',
Expand Down Expand Up @@ -198,10 +198,6 @@ protected function backupImport($file, $input)
'--compression' => 'gzip',
);

if ($input->getOption('drop-tables')) {
$params['--drop-tables'] = true;
}

try {
if ($returnCode = $importCommand->run(new ArrayInput($params), $this->getOutput())) {
$this->getOutput()->writeln('<error>magerun db:import failed to import database.</error>');
Expand Down
4 changes: 3 additions & 1 deletion src/Meanbee/Magedbm/Command/PutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,15 @@ private function createBackupWithoutExec(InputInterface $input, OutputInterface
array(
'include-tables' => $stripTables,
'no-data' => true,
'add-drop-table' => true,
)
);

$dumpStructure->start($filePath . '.structure');

$dump = new Mysqldump(sprintf('%s;dbname=%s', $dbHelper->dsn(), $dbName), $username, $password, array(
'exclude-tables' => $stripTables
'exclude-tables' => $stripTables,
'add-drop-table' => true,
));

$dump->start($filePath . '.data');
Expand Down

0 comments on commit 8d66951

Please sign in to comment.