views:

23

answers:

1

Hi there!

I would like to cancel the mandatory of a field of my current schema. How can I accomplish that with a symfony migration?

Thanks in advance, Best regards!

+2  A: 

Migrations are intended to alter database, not schema. So you have to alter your schema yourself.

Also, for me best and cleanest way is to edit schema manually (just remove notnull: true on desired column) and issue symfony doctrine:generate-migrations-diff. This will generate new migration class which you have to review and test (with symfony doctrine:migrate --env=dev).

develop7
Before anything else, thanks for the help! Your methodology sounds perfect to me but my symfony framework version is 1.2. As far I can test, the task that you mentioned is not present on this version.Best regards!
Rui Gonçalves
Rui, run `symfony list doctrine` first. AFAIK, nevertheless symfony 1.2 contains Doctrine 1.0.x, migrations are available in this version.Also, I strongly advice to upgrade to symfony 1.3.
develop7
Yes, migrations are available in my current symfony version but the previously mentioned task symfony doctrine:generate-migrations-diff is not. And yes, one of my top priorities is to upgrade for a higher version of symfony.
Rui Gonçalves