Quantcast
Channel: Doctrine create foreign key - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by user3631654 for Doctrine create foreign key

The solution is simple. It can only be a relation or a datatype (string, object, int). So my example requires a relation, so I had to remove the @ORM\Column-annotation and it worked!

View Article



Answer by Debreczeni András for Doctrine create foreign key

This usually happens if your database table engine type does not support foreign keys (such as MyISAM). Try changing your engine type for example to InnoDB, then run console doctrine:schema:update

View Article

Doctrine create foreign key

I'm having trouble with foreign keys in doctrine. I have a "User"-table and a "Orders"-table. Now I want to have a foreign key from userID in the orders-table to the id in the user-table. The...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images