Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony same code, different server, no field or assocation

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?

like image 649
Angelo A Avatar asked Jun 15 '15 12:06

Angelo A


1 Answers

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.

like image 101
Angelo A Avatar answered Oct 28 '22 13:10

Angelo A