Bug corrected when the database has no table in the command table:drop
This commit is contained in:
parent
5a1f644a6a
commit
f74c659f24
|
@ -93,10 +93,17 @@ EOT
|
|||
|
||||
$tablesToDelete = join(', ', $tablesToDelete);
|
||||
|
||||
$dropStatement = $connection->prepare('DROP TABLE ' . $tablesToDelete . ' ;');
|
||||
$dropStatement->execute();
|
||||
if ($tablesToDelete != '')
|
||||
{
|
||||
$dropStatement = $connection->prepare('DROP TABLE ' . $tablesToDelete . ' ;');
|
||||
$dropStatement->execute();
|
||||
|
||||
$output->writeln(sprintf('Table' . $tablePlural . ' <info><comment>%s</comment> has been dropped.</info>', $tablesToDelete));
|
||||
$output->writeln(sprintf('Table' . $tablePlural . ' <info><comment>%s</comment> has been dropped.</info>', $tablesToDelete));
|
||||
}
|
||||
else
|
||||
{
|
||||
$output->writeln('No table <info>has been dropped</info>');
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue