title: One to One mapping on the same entity remove issue Symfony
body: <p>I have an entity Product that can be linked to another product of the same type ( So one to one mapping from Product to Product ).</p>
  
  <p>The problem occurs when I'm trying to remove the product from the database because it has a foreign key.</p>
  
  <blockquote>
    <p>An exception occurred while executing 'DELETE FROM product WHERE id = ?' with params ["25"]:
    SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (<code>acme</code>.<code>product</code>, CONSTRAINT <code>FK_BAD80AF68031A592</code> FOREIGN KEY (<code>linked_to_id</code>) REFERENCES <code>product</code> (<code>id</code>))</p>
  </blockquote>
  
  <p>This is how I defined the relationship</p>
  
  <pre><code>/**
   * @ORM\OneToOne(targetEntity="App\Entity\Product", cascade={"persist", "remove"})
   * @ORM\JoinColumn(name="linked_to_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
   */
  private $linkedTo;
  </code></pre>
  
  <p>Any ideas what to set on the relationship to avoid this FK removal issue?</p>