Hi there!
Can anyone please tell me how can I add a new column of type enum to my schema in order to implement a Doctrine Migration?
Thanks in advance, Best regards!
Hi there!
Can anyone please tell me how can I add a new column of type enum to my schema in order to implement a Doctrine Migration?
Thanks in advance, Best regards!
Modify your schema and don't build yet the model. run doctrine schema diff then a migration class will be generated for you. Finally you can rebuild your models/forms/filters
modify your schema
run ./symfony doc:generate-migrations-diff
this will generate one or more files in lib/migrations/doctrine/
./symfony doc:migrate
this will apply the generated migrations to the database
./symfony doc:build --all-classes
this works for symfony >= 1.3/1.4 and will rebuild all form/filters/model classes according to the modified schema
remember that the migration is generated comparing the new schema.yml to the current model classes, so if you rebuild your classes before running generate-migrations-diff you're screwed.