Skip to content

Commit

Permalink
[MT] fix for broken alter-table statements when default column values…
Browse files Browse the repository at this point in the history
… contained a semicolon
  • Loading branch information
manfred-w committed Jun 22, 2020
1 parent d80f0b1 commit 2310e76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Propel/Generator/Platform/DefaultPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Propel\Generator\Model\Diff\DatabaseDiff;
use Propel\Generator\Model\Diff\TableDiff;
use Propel\Generator\Exception\EngineException;
use Propel\Generator\Util\SqlParser;
use Propel\Runtime\Connection\ConnectionInterface;

/**
Expand Down Expand Up @@ -815,7 +816,10 @@ public function getModifyTableDDL(TableDiff $tableDiff)
if ($columnChanges) {
//merge column changes into one command. This is more compatible especially with PK constraints.

$changes = explode(';', $columnChanges);
$sqlParser = new SqlParser();
$sqlParser->setSQL($columnChanges);
$changes = $sqlParser->explodeIntoStatements();

$columnChanges = [];

foreach ($changes as $change) {
Expand Down

0 comments on commit 2310e76

Please sign in to comment.