Escaping table name in the table:drop command and improve error message for the fixtures:load command

This commit is contained in:
Maxime AILLOUD 2011-10-24 12:19:42 +02:00
commit a6bb5d2d52
2 changed files with 3 additions and 3 deletions

View file

@ -100,10 +100,10 @@ EOT
$connection->exec('SET FOREIGN_KEY_CHECKS = 0;');
$tablesToDelete = join(', ', $tablesToDelete);
$tablesToDelete = join('`, `', $tablesToDelete);
if ('' !== $tablesToDelete) {
$connection->exec('DROP TABLE ' . $tablesToDelete . ' ;');
$connection->exec('DROP TABLE `' . $tablesToDelete . '` ;');
$output->writeln(sprintf('Table' . $tablePlural . ' <info><comment>%s</comment> has been dropped.</info>', $tablesToDelete));
}