title: Integrity constraint violation: 1451 Cannot delete or update a parent row
body: <p>I have this foreign key:</p>
  
  <pre><code>ALTER TABLE `tags`
    ADD CONSTRAINT `file_fk` FOREIGN KEY (`file_id`) 
    REFERENCES `files` (`id`);
  </code></pre>
  
  <p>When I delete row in <code>files</code> and there are <code>tags</code> left associated with that file, I get <code>Integrity constraint violation: 1451 Cannot delete or update a parent row</code> understandably. What should I do? Can I delete a file and then tags associated with it, or I need to remove tags first and then the file and there's just no other way?</p>
  
  <p>EDIT: Just found out about <code>ON DELETE CASCADE</code>, so probably I should this instead, yeah?</p>