I have two servers (on locally and one production). They have the same settings. The only thing I update when I want my new code to go to production is the src folder. So this folder is exactly the same when I push a release.
On my local server the new column in my entity/table works, and can be created, updated, etc. But on my production environment, this new column isn't noticed or even selected by doctrine.
The new column is in my database (both production and local), is in my entity.php
file, in my entity.orm.yml
file.
I did the app/console cache:clear
option. Both dev and prod and on both servers.
What am I doing wrong?
Finally found the solution.
Because I didn't use metadata cache on the local server, but I did on my production server, it saved my mapping information. That's why doctrine didn't knew I had new columns. The solution was to clear the metadata cache using:
php bin/console doctrine:cache:clear-metadata
After that I run php bin/console doctrine:schema:update --dump-sql
and I got the new columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With