0

When I update my schema (php app/console doctrine:schema:update --force ), generated tables don't have foreign key constraint. In phpmyadmin I can insert data manually in these tables without put value for foreign keys (ManyToOne variable in Doctrine ORM Entity).

So I ask myself is it a normal behavior or am I missing something while creating entities.

Thank's a lot (and sorry for my english)

bvsmith
  • 5
  • 3

1 Answers1

0

You do this with your annotations and map on both entities:

Please see:

How can I use 'foreign key' on doctrine?

and

http://docs.doctrine-project.org/en/2.0.x/reference/annotations-reference.html#annref-onetomany

for examples.

Community
  • 1
  • 1
Shawn
  • 3,583
  • 8
  • 46
  • 63