phpgitsymfonydoctrinesymfony3

Symfony3 Doctrine schema update after switched git branch displays error


For a Symfony 3.4 project, after having switched on an existing branch on git, I made a

php bin/console doctrine:schema:update --force

in order to create new needed fields in database.

I'm facing an error:

In AbstractMySQLDriver.php line 60: An exception occurred while executing 'SELECT t0.id AS id_1, t0.name AS name_2, t0.real_name AS real_name_3, ...

SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.real_name' in 'field list'

That's precisely the field I want to add in my database, so why I am getting this error ?

Tried doctrine:cache:clear-metadata, cache:clear, ...,

Thank you for your help.


Solution

  • I found the problem: In a Service __construct method, I have a query on the table which missed fields. I think that any symfony command (cache clear, doctrine schema) must check the integrity of all services before running them.