Index: branches/5.2.x/core/units/helpers/deployment_helper.php =================================================================== diff -u -N -r16588 -r16703 --- branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16588) +++ branches/5.2.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16703) @@ -1,6 +1,6 @@ $sql ) { if ( substr($sql, 0, 1) == '#' ) { // output comment as is $this->toLog($sql); @@ -553,6 +553,26 @@ // consider revisions with errors applied $this->appliedRevisions[] = $revision; + $this->out('========', true); + $this->toLog('========'); + + foreach ( array_slice($sqls, $line_number) as $sql ) { + if ( substr($sql, 0, 1) == '#' ) { + // Output comment as is. + $this->toLog($sql); + echo $this->colorText($sql, 'purple') . PHP_EOL; + continue; + } + elseif ( $sql ) { + $this->toLog($sql); + $escaped_sql = $this->isCommandLine ? $sql : kUtil::escape($sql); + echo $escaped_sql . ';' . PHP_EOL; + } + } + + $this->out('========', true); + $this->toLog('========'); + return false; } @@ -576,10 +596,14 @@ */ public function handleSqlError($code, $msg, $sql) { - $this->toLog('FAILED' . PHP_EOL . 'SQL Error #' . $code . ': ' . $msg); + $error_msg = 'FAILED' . PHP_EOL . 'SQL Error #' . $code . ': ' . $msg; + $this->toLog($error_msg); + $this->displayStatus($error_msg); - $this->displayStatus('FAILED' . PHP_EOL . 'SQL Error #' . $code . ': ' . $msg); - $this->out('Please execute rest of SQLs in this Revision by hand and run deployment script again.', true); + $info_msg = 'Execute rest of SQLs in this Revision (show below) by hand and '; + $info_msg .= 'RUN deployment script again to complete the deployment process.'; + $this->toLog($info_msg); + echo $this->colorText($info_msg, 'red', true) . PHP_EOL; throw new Exception($msg, $code); }