propelorm/Propel — pull request #621 by fliespl (2013-02-26 08:33:53+00:00)
Title: Don't null size field when scale specified

This is an issue that I come upon using propel migration. It always tried to migrate my decimal column with the same values.

After inspecting closely I have figured that reverse schema parser sets null to $size variable (even if $scale) is specified.

This way, when migrator compares columns it has $size = 10 in schema.xml and $size = null in database (because reverse mysql class changes native sizes to null).

Real life example:
XML:
latitude: { phpName: Latitude, type: DECIMAL, size: 10, scale: 7, required: false }

DB:
`latitude` decimal(10,7) DEFAULT NULL,

produces migration queries as such:

getUpSQL:
ALTER TABLE `venues` CHANGE `latitude` `latitude` DECIMAL(10,7);

getDownSQL:
ALTER TABLE `venues` CHANGE `latitude` `latitude` DECIMAL;

As you can see in getDownSQL, database reverse parser didn't account for size+scale combination and assumed that size is 10,0.