Skip to content
Advertisement

The referenced column name has to be a primary key column on the target entity class

everyone. Happy new year! Today I am having problems trying to resolving this problem:

Could not resolve type of column “id_usuario” of class “FacturadorVirtualModelosSeguridadUsuario”

For some, this error is only present in linux enviroment. In windows, no problem. What the problem is exactly? Looks like PlanAdquirido is not finding the column id_usuario through the relationship $adquiridoPor. Again: this error is only triggered in linux enviroment.

Usuario entity:

JavaScript

PlanAdquirido entity:

JavaScript

If I run "vendor/bin/doctrine.bat" orm:validate-schema in windows I get:

JavaScript

But in linux I get:

JavaScript

Column name id_usuario referenced for relation from FacturadorVirtualModelosPlanesPlanAdquirido towards FacturadorVirtualModelosSeguridadUsuario does not exist.

I do not know if I am missing something, but have I have two days trying to figure out why is not working in linux (where production will reside).

  • Tables and column’s name are all in lower case, using MySQL 5.7

Advertisement

Answer

Today I found the answer. The problem was redi’s cache. Everytime the project was updated I ran the clear cache command:

JavaScript

I thought that this command already cleared the cache, but it did not. To clear the cache correcly just run:

JavaScript

All works great now since then!

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement