Hey guys i have an error (i think that i do a really idiot error but i don't see were) trying to waste time i ask you the question. The error is that my foreign keys is incorrectly formed. Cannot be more precise ... Thx to all people who will try to answer or search :p
My UserInterestEntity :
/**
* UserInterest
*
* @ORM\Table(name="user_interest", indexes {@ORM\Index(name="userInterest_category_id_fk", columns={"category_id"})})
* @ORM\Entity
*/
class UserInterest
{
/**
* @var \AppBundle\Entity\Category
*
* @ORM\Id
* @ORM\ManyToOne(targetEntity="Category")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
* })
*/
private $category;
}
My Category Entity :
/**
* UserInterest
*
* @ORM\Table(name="Category", uniqueConstraints {@ORM\UniqueConstraint(name="category_id_uindex", columns={"id"})})
* @ORM\Entity
*/
class Category
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\OneToOne(targetEntity="UserInterest", inversedBy="Category")
*/
protected $id;
The error is that when i do : php bin/console doctrine:schema:update --force tat tells me : Foreign key constraint is incorrectly formed