15

Navigating my app built with Symfony I discovered some mappings of some entities are inconsistent.

The Symfony Profiler tells me this:

AppBundle\Entity\Email The mappings AppBundle\Entity\Email#forCustomer and AppBundle\Entity\Customer#emails are inconsistent with each other.

and, in reverse:

AppBundle\Entity\Customer The association AppBundle\Entity\Customer#emails refers to the owning side field AppBundle\Entity\Email#owner which does not exist.

How can I check all entities in one time to discover this kind of inconsistency, without having to navigate all the app hoping I discover other inconsistencies?

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Aerendir
  • 6,152
  • 9
  • 55
  • 108

1 Answers1

22

For Symfony version lower than 3.4 you can try with:

app/console doctrine:schema:validate

and for Symfony 3.4, 4.* and 5.*:

bin/console doctrine:schema:validate

crmpicco
  • 16,605
  • 26
  • 134
  • 210
scoolnico
  • 3,055
  • 14
  • 24