Fix issue with restoring backups older than the last new DB table created.
This commit is contained in:
parent
72cc75b8c6
commit
5f63db9cae
|
@ -80,9 +80,14 @@ class RestoreCommand extends CommandAbstract
|
|||
return 1;
|
||||
}
|
||||
|
||||
// Drop all preloaded tables prior to running a DB dump backup.
|
||||
$conn = $em->getConnection();
|
||||
$connParams = $conn->getParams();
|
||||
|
||||
foreach ($conn->fetchFirstColumn('SHOW TABLES') as $table) {
|
||||
$conn->executeQuery('DROP TABLE ' . $conn->quoteIdentifier($table));
|
||||
}
|
||||
|
||||
$this->passThruProcess(
|
||||
$io,
|
||||
'mysql --host=$DB_HOST --user=$DB_USERNAME --password=$DB_PASSWORD $DB_DATABASE < $DB_DUMP',
|
||||
|
|
Loading…
Reference in New Issue