camcima / php-mysql-diff

MySQL Schema Diff - Comparison / Migration Script Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ROW_FORMAT error when change to default

WADS94 opened this issue · comments

If the from table has a ROW_FORMAT and the to table doesn't the migration sql is:
ALTER TABLE table_name
ROW_FORMAT=;

Which is not a correct format, it should be ROW_FORMAT=DEFAULT

From what I looked the problem is in Camcima\MySqlDiff\Model\ChangedTable:383
$tableChanges[] = sprintf('ROW_FORMAT=%s', $this->toTable->getRowFormat());
And this fix it:
$toRowFormat = $this->toTable->getRowFormat(); if( empty($toRowFormat) ){ $toRowFormat = 'DEFAULT'; } $tableChanges[] = sprintf('ROW_FORMAT=%s', $toRowFormat);
If you think this is ok , I can make PR.