title: Two image tables or one for storing default images?
body: <p>I currently maintain a single DB table that has some info for images that are stored in a file system.  This setup works well with the several hundred thousand photos I currently have recorded.  </p>
  
  <p>For a users default image I maintain a separate folder that contains the photo but this has become a maintenance nightmare. Should I create a second table that stores a reference to the default photo from table 1 or is it better to add a new field in table 1 that's a boolean I can set to indicate a default photo?</p>
  
  <p>My table looks something like this:</p>
  
  <pre><code>image_table
  id  user_id  file_name 
  1   6        xvy.jpeg  
  2   6        abc.jpeg  
  3   6        def.jpeg
  </code></pre>
  
  <p>Proposed solution:</p>
  
  <pre><code>image_table
  id  user_id  file_name default
  1   6        xvy.jpeg  0
  2   6        abc.jpeg  1
  3   6        def.jpeg  0
  </code></pre>
  
  <p>In this proposed solution it seems as though I would need to make two SQL calls to reset the default and then a second call to set a new default photo if a user changes it...</p>