php-mysql-diff
php-mysql-diff copied to clipboard
ROW_FORMAT error when change to default
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.