title: User Address relationship MySQL - Database Design
body: <p>I'm getting confused on how I should design my database schema for an Ecommerce site.
  I want to create an address profile for my users.  </p>
  
  <p>By default, the shipping address is the same with the billing address. 
  The user can't create new billing address, but he can add more shipping address.
  If there is no shipping address then it will use the billing address as default shippign address..</p>
  
  <p>My problem is that, whenever I change my shipping address or billing address, I must first toggle the "active" field for both of my tables ("billing", and "shipping).</p>
  
  <p>Example</p>
  
  <pre>
  Billing Address
  1. Miami 
  
  Shipping Address
  1. Miami  -(active)
  2. New York
  3. Boston
  </pre>
  
  <p>When I set my Shipping address to new york, I don't like the idea of updating the rest of the fields to 0 and then setting new york to 1.</p>
  
  <p>Is there a better implementation?? Should I just create another field in my users table which indicates the selected address??   Should I merge both Address tables to form one address collection only? </p>
  
  <p>Schema 
    User = id, name</p>
  
  <p>Shipping Address = id, user_id, complete_address, active  </p>
  
  <p>Billing Address = id, user_id, complete_address, active  </p>