I'm using Symfony 1.4 and Propel 1.6 with a MySQL 5.1.
Every time I make little changes on schema.xml
(add one field in one table for example), I use to execute:
php symfony propel:build-all --classes-only --env=dev
php symfony propel:diff --env=dev
php symfony propel:up --env=dev
In the second step, the task always generates SQL sentences for ALL the fields in ALL tables of the type alter table change
fieldfield
integer not null
or drop/create constraints that didn't change at all:
ALTER TABLE `pedido_linea` CHANGE `id` `id` INTEGER(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `product` CHANGE `norma_id` `norma_id` INTEGER(11);
...
ALTER TABLE `pedido_linea` DROP FOREIGN KEY `pedido_linea_FK_2`;
ALTER TABLE `pedido_linea` ADD CONSTRAINT `pedido_linea_FK_2`
FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT;
It seems like Propel doesn't read MySQL's fields' attributes correctly and treats them as changed. It's very annoying because I've to scan all the generated script to check that it's what I want it to be. Is there a workaround for this?