I am running sonata admin and I have an existing working entity/admin. I've added another 2 columns to the doctrine orm, the entity, the admin and ran the app/console doctrine:schema:update commands to get the fields in to the database successfully.
On local dev environment, this works great.
On production, the new fields aren't saving.
When saving the entity within sonata admin if I manually call $this->isMyNewField() in preUpdate or postUpdate I get the correct result of true or false depending on whether i checked the box or not.
However doctrine doesn't seem to be correctly registering the field at all, i've logged the sql that it is running on update and persist and it literally doesn't even try and do anything with the field whatsoever on either.
If I change the AppKernel to run on 'dev' rather than 'prod' (on production environment) then all works as expected and doctrine picks it up without an issue.
Ive tried clearing doctrine metadata, clearing cache, restarting servers, changing field types, removing in doctrine and re-adding (via the entity orm xml file)
Still no luck. Any other ideas I can try?
Thanks
Kevin
Hi all turns out it was the command
app/console doctrine:cache:clear-metadata
That needed running, I had tried this without success so the big thing I missed off it was the env so the command was
app/console doctrine:cache:clear-metadata --env=prod
Was fine after this, very frustrating