title: postgresql on delete cascade
body: <p>I have two tables:</p>
  
  <pre><code>TableY:
      id, name, description
  
  TableX:
      id, name, y_id
  </code></pre>
  
  <p>I have added a foreign key in <code>TableX</code> (<code>y_id REFERENCING tableY id ON DELETE CASCADE</code>). 
  When I delete from <code>TableX</code>, the <code>TableY</code> <code>id</code> remains (while it theoritically should be deleted). 
  I guess I have misunderstood how the <code>ON DELETE CASCADE</code> option works. Can anyone tell what I am doing wrong? </p>
  
  <p>I saw this <a href="https://stackoverflow.com/questions/5493227/on-delete-cascade">ON DELETE CASCADE</a> as well but did not make much sense to me.</p>