Commit c7ea8c78 authored by guilhermeblanco's avatar guilhermeblanco

[2.0] Fixed SchemaTool CLI Task which was throwing PDOExceptions

parent 6368eb6a
...@@ -170,8 +170,13 @@ class SchemaToolTask extends AbstractTask ...@@ -170,8 +170,13 @@ class SchemaToolTask extends AbstractTask
} }
} else { } else {
$printer->writeln('Creating database schema...', 'INFO'); $printer->writeln('Creating database schema...', 'INFO');
$tool->createSchema($classes);
$printer->writeln('Database schema created successfully.', 'INFO'); try {
$tool->createSchema($classes);
$printer->writeln('Database schema created successfully.', 'INFO');
} catch (\Exception $ex) {
$printer->writeln($ex->getMessage(), 'ERROR');
}
} }
} else if ($isDrop) { } else if ($isDrop) {
if (isset($args['dump-sql'])) { if (isset($args['dump-sql'])) {
...@@ -180,8 +185,13 @@ class SchemaToolTask extends AbstractTask ...@@ -180,8 +185,13 @@ class SchemaToolTask extends AbstractTask
} }
} else { } else {
$printer->writeln('Dropping database schema...', 'INFO'); $printer->writeln('Dropping database schema...', 'INFO');
$tool->dropSchema($classes);
$printer->writeln('Database schema dropped successfully.', 'INFO'); try {
$tool->dropSchema($classes);
$printer->writeln('Database schema dropped successfully.', 'INFO');
} catch (\Exception $ex) {
$printer->writeln($ex->getMessage(), 'ERROR');
}
} }
} else if ($isUpdate) { } else if ($isUpdate) {
$printer->writeln("--update support is not yet fully implemented.", 'ERROR'); $printer->writeln("--update support is not yet fully implemented.", 'ERROR');
...@@ -192,8 +202,13 @@ class SchemaToolTask extends AbstractTask ...@@ -192,8 +202,13 @@ class SchemaToolTask extends AbstractTask
} }
} else { } else {
$printer->writeln('Updating database schema...', 'INFO'); $printer->writeln('Updating database schema...', 'INFO');
$tool->updateSchema($classes);
$printer->writeln('Database schema updated successfully.', 'INFO'); try {
$tool->updateSchema($classes);
$printer->writeln('Database schema updated successfully.', 'INFO');
} catch (\Exception $ex) {
$printer->writeln($ex->getMessage(), 'ERROR');
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment