title: error 1215 cannot add foreign key constraint symfony
body: <p>I have a problem with symfony in creating relationship between my entities. I wish to make a ManyToOne relationship between my body and my body Registration University. An inscription is linked to a university.</p>
  
  <p>class inscription:</p>
  
  <pre><code>/**
  * Inscription
  *
  * @ORM\Table(name="Inscription")
  *     @ORM\Entity(repositoryClass="IEPA\PlatformBundle\Repository\InscriptionRepository")
  */
  class Inscription
  {
  /**
  * @ORM\Id
  * @ORM\Column(name="id", type="integer", nullable=true)
  * @ORM\GeneratedValue(strategy="AUTO")
  */
  private $id;
  /**
  * @var integer
  * 
  * @ORM\ManyToOne(targetEntity="IEPA\PlatformBundle\Entity\Universites")
  * @ORM\JoinColumn(nullable=false)
  */
  private $univInsc;
  }
  </code></pre>
  
  <p>class universites:</p>
  
  <pre><code>/**
  * Universites
  *
  * @ORM\Table(name="universites")
  * @ORM\Entity
  * @ORM\Entity(repositoryClass="IEPA\PlatformBundle\Repository\UniversitesRepository")
  */
  class Universites
  {
  /**
   * @var integer
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  private $id;
  }
  </code></pre>
  
  <p>When I update the database (php app / console doctrine : schema : update --force ) , I get the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/usUYc.jpg" alt=""></p>
  
  <pre><code>[Doctrine\DBAL\Exception\DriverException]
  An exception occured while executing `ALTER TABLE inscription ADD CONTRAINT FK_D80C7901C5E240F6 FOREIGN KEY (univ_insc_id) REFERENCE universites (id):
  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
  </code></pre>