title: MySQL: Cascade vs. Restrict
body: <p>I'm working on a database and am using many foreign keys to connect my tables. By default, MySQL sets all of the <code>ON UPDATE</code> and <code>ON DELETE</code> to <code>RESTRICT</code>. This seemed to work fine.</p>
  
  <p>Then one time, I wanted to change the <code>id</code> of several of the rows in a table. This table was involved in many relationships, so I changed the relations to <code>CASCADE</code> so that the changes would be cascaded to the tables that used that <code>id</code> as a foreign key.</p>
  
  <p>Now I think to myself, is there any reason to leave the relations as <code>RESTRICT</code>, since <code>CASCADE</code> seems to make my life easier?</p>