Use a variable for the DBMS tyoe we are converting to.

This commit is contained in:
Andreas Fischer 2014-04-15 17:05:31 +02:00
parent 714343cd74
commit 9823d54bb8
1 changed files with 5 additions and 4 deletions

View File

@ -109,10 +109,11 @@ class ConvertType extends Command {
} }
protected function execute(InputInterface $input, OutputInterface $output) { protected function execute(InputInterface $input, OutputInterface $output) {
if ($input->getArgument('type') === $this->config->getValue('dbtype', '')) { $type = $input->getArgument('type');
if ($type === $this->config->getValue('dbtype', '')) {
$output->writeln(sprintf( $output->writeln(sprintf(
'<error>Can not convert from %1$s to %1$s.</error>', '<error>Can not convert from %1$s to %1$s.</error>',
$input->getArgument('type') $type
)); ));
return 1; return 1;
} }
@ -121,14 +122,14 @@ class ConvertType extends Command {
$toDB = $this->getToDBConnection($input, $output); $toDB = $this->getToDBConnection($input, $output);
if ($input->getOption('clear-schema')) { if ($input->getOption('clear-schema')) {
if ($input->getArgument('type') === 'oci') { if ($type === 'oci') {
// Doctrine unconditionally tries (at least in version 2.3) // Doctrine unconditionally tries (at least in version 2.3)
// to drop sequence triggers when dropping a table, even though // to drop sequence triggers when dropping a table, even though
// such triggers may not exist. This results in errors like // such triggers may not exist. This results in errors like
// "ORA-04080: trigger 'OC_STORAGES_AI_PK' does not exist". // "ORA-04080: trigger 'OC_STORAGES_AI_PK' does not exist".
$output->writeln(sprintf( $output->writeln(sprintf(
'<error>The --clear-schema option is not supported when converting to Oracle (oci).</error>', '<error>The --clear-schema option is not supported when converting to Oracle (oci).</error>',
$input->getArgument('type') $type
)); ));
return 1; return 1;
} }