Description:
When altering a table, namely adding columns, sql script generated tries to first reorder the fields and then creates new columns.
Say:
ALTER TABLE `some_table`
CHANGE COLUMN `type` `type` ENUM('type1','type2') NULL DEFAULT NULL AFTER `new_column`,
ADD COLUMN `new_column` DECIMAL(10,2) NULL DEFAULT NULL AFTER `other_column`;
of course server balked at it saying that 'new_column' does not exist (in line 2 in AFTER statement).
How to repeat:
Create a new column and move some other column to be after it then try to synchronize.
Suggested fix:
Perhaps move ADD COLUMN to the front of the statement before any CHANGE COLUMN?
This could create conundrums of its own if new columns are supposed to be after the rearranged columns which wont be rearranged at the point of creating new columns yet, but this can be easily remedied by running synchronize twice. Now its impossible to finish it - every time it throws 'unknown column' error.
Description: When altering a table, namely adding columns, sql script generated tries to first reorder the fields and then creates new columns. Say: ALTER TABLE `some_table` CHANGE COLUMN `type` `type` ENUM('type1','type2') NULL DEFAULT NULL AFTER `new_column`, ADD COLUMN `new_column` DECIMAL(10,2) NULL DEFAULT NULL AFTER `other_column`; of course server balked at it saying that 'new_column' does not exist (in line 2 in AFTER statement). How to repeat: Create a new column and move some other column to be after it then try to synchronize. Suggested fix: Perhaps move ADD COLUMN to the front of the statement before any CHANGE COLUMN? This could create conundrums of its own if new columns are supposed to be after the rearranged columns which wont be rearranged at the point of creating new columns yet, but this can be easily remedied by running synchronize twice. Now its impossible to finish it - every time it throws 'unknown column' error.