php-mysql-diff icon indicating copy to clipboard operation
php-mysql-diff copied to clipboard

ROW_FORMAT error when change to default

Open WADS94 opened this issue 7 years ago • 0 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.

WADS94 avatar Nov 07 '17 14:11 WADS94