3

I've got big troubles with doctrine cache. Context:

  • schema updated (an entity with new table name)
  • cache deleted (definitively removed by hand)
  • cache cleared (with a doctrine command)

    rm -fr var/cache/prod/ rm -fr var/cache/dev/ rm -fr var/cache/de*

    php bin/console doctrine:cache:clear-metadata --env=prod php bin/console doctrine:cache:clear-query --env=prod php bin/console doctrine:cache:clear-result --env=prod

After this sequence of commands, ... I am trying to update the schema. As you can see doctrine:schema:update says that queries were executed. But the fact is that the message is always the same. Also, ... I can say that entity entity annotation is changed ...

from

/**
 * @ORM\Table(name="u_i_options")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\UIOptionsRepository")
 * @JMS\ExclusionPolicy("all")
 */

to

/**
 * @ORM\Table(name="uioptions")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\UIOptionsRepository")
 * @JMS\ExclusionPolicy("all")
 */

So, ... the schema is definitively changed.

 forge@foo:~/api-test.example.com$ php ./bin/console doctrine:schema:update --env=prod --force
PHP Warning:  Module 'newrelic' already loaded in Unknown on line 0
Updating database schema...
Database schema updated successfully! "6" queries were executed
forge@foo:~/api-test.example.com$ php ./bin/console doctrine:schema:update --env=prod --force
PHP Warning:  Module 'newrelic' already loaded in Unknown on line 0
Updating database schema...
Database schema updated successfully! "6" queries were executed
forge@mt-test:~/api-test.example.com$ php ./bin/console doctrine:schema:update --env=prod --force
PHP Warning:  Module 'newrelic' already loaded in Unknown on line 0
Updating database schema...
Database schema updated successfully! "6" queries were executed
forge@foo:~/api-test.example.com$ php ./bin/console doctrine:schema:update --env=prod --force
PHP Warning:  Module 'newrelic' already loaded in Unknown on line 0
Updating database schema...
Database schema updated successfully! "6" queries were executed

Also restarting php service the problem persists: this sequence of command does not update the schema.

I've also disable all doctrine's cache configurations.

sensorario
  • 20,262
  • 30
  • 97
  • 159
  • can you show us which 6 queries are executed? `doctrine:schema:update --env=prod --dump-sql` – LBA May 19 '17 at 09:09
  • Yes, but are not related to the schema changes – sensorario May 19 '17 at 09:12
  • so your issue is, a planned schema update is not happening while unplanned updates are executed every time? – LBA May 19 '17 at 09:57
  • No: every time i run `doctrine:schema:update` in a particular environment the output message says that queries were executed but the schema remain the same. This happens also if I drop the database. The schema is the old one. – sensorario May 19 '17 at 10:45
  • @sensorario Did the problem is solved? If not I would take a look at the connection to the database e.g. the parameters... – goulashsoup Aug 16 '17 at 22:03

0 Answers0