Migrations create uncessary ALTER TABLE statements when sqlType="" used in schema #811

Open
exptom opened this Issue Jan 8, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@exptom
Contributor

exptom commented Jan 8, 2014

I am using sqlType="INTEGER UNSIGNED" on a number of columns in a MySQL database. When I run the diff propel creates an ALTER TABLE statement for every column that has an sqlType="" defined.

e.g.
The getUpSQL() has lots of:
ALTER TABLE Bookings CHANGE id id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT;

and the getDownSQL() has lots of:
ALTER TABLE Bookings CHANGE id id int(10) unsigned NOT NULL AUTO_INCREMENT;

This happens every time I run a diff.
e.g. diff, migrate (changes are applied), diff (same set of alter table statements are generated).

Happens on both Propel 1.6.9 and 1.7.0

@exptom

This comment has been minimized.

Show comment Hide comment
@exptom

exptom Jan 8, 2014

Contributor

Just discovered I get exactly the same problem with a varbinary column:

schema.xml

getUpSQL:
ALTER TABLE Settings CHANGE valueBinary valueBinary MEDIUMBLOB;

getDownSQL:
ALTER TABLE Settings CHANGE valueBinary valueBinary LONGBLOB;

Contributor

exptom commented Jan 8, 2014

Just discovered I get exactly the same problem with a varbinary column:

schema.xml

getUpSQL:
ALTER TABLE Settings CHANGE valueBinary valueBinary MEDIUMBLOB;

getDownSQL:
ALTER TABLE Settings CHANGE valueBinary valueBinary LONGBLOB;

@armezit

This comment has been minimized.

Show comment Hide comment
@armezit

armezit Nov 2, 2015

@exptom Did you got a workaround for this? It's very annoying.

armezit commented Nov 2, 2015

@exptom Did you got a workaround for this? It's very annoying.

@exptom

This comment has been minimized.

Show comment Hide comment
@exptom

exptom Nov 3, 2015

Contributor

No, we have just been removing the unnecessary SQL from the migration each time.

Contributor

exptom commented Nov 3, 2015

No, we have just been removing the unnecessary SQL from the migration each time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment