From b0e6542dc2a72289a396d2e29604e4e83a6136a2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 14 Apr 2014 18:29:47 +0200 Subject: [PATCH] Add error handling for --clear-schema on Oracle. --- core/command/db/converttype.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php index 6ab2d893c6..64178d1ef7 100644 --- a/core/command/db/converttype.php +++ b/core/command/db/converttype.php @@ -120,6 +120,17 @@ class ConvertType extends Command { $toDB = $this->getToDBConnection($input, $output); if ($input->getOption('clear-schema')) { + if ($input->getArgument('type') === 'oci') { + // Doctrine unconditionally tries (at least in version 2.3) + // to drop sequence triggers when dropping a table, even though + // such triggers may not exist. This results in errors like + // "ORA-04080: trigger 'OC_STORAGES_AI_PK' does not exist". + $output->writeln(sprintf( + 'The --clear-schema option is not supported when converting to Oracle (oci).', + $input->getArgument('type') + )); + return 1; + } $this->clearSchema($toDB->getSchemaManager(), $input, $output); }