title: Optimal database design for extensibility
body: <p>I'm designing a database and matching website for my internship using the Yii Framework, working mostly in PHP.  Our goal is to allow administrative users complete flexibility in what information they want to display, so we're trying to keep the application dynamic. Because of this the idea is to the options/data in the database, instead of inside the code.  I currently have a working setup, but i'm not sure if it's the right way to go about it. Long post guys, sorry.  At the moment we have:</p>
  
  <p>Relations<br>
  + user <code>HAS MANY</code> user_phone<br>
  + user_phone <code>HAS MANY</code> user<br>
  + user_phone <code>HAS</code> user_phone_type<br> </p>
  
  <p>Tables<br>
  user &lt;-- user_phone_assignment --> user_phone --> user_phone_type<br></p>
  
  <p>user_phone_type<br>
  <code>id INT PRIMARY KEY,</code><br>
  <code>name VARCHAR(50) NOT NULL,</code><br>
  <code>limit INT NOT NULL</code><br></p>
  
  <p>Basic user profile information is stored in user, and to reduce repeated data in the instance of family and siblings, user_phone has an assignment table for potential many to many.  The idea with user_phone_type is that we store a name such as "Home", "Work", "Fax", "Other", etc.</p>
  
  <p><code>user_phone_type.limit &lt; 0</code><br>
   + field disabled, not displayed for actionCreatePhone<br>
  <code>user_phone_type.limit = 0</code><br>
   + field enabled, unlimited entries allowed, always displayed<br>
  <code>user_phone_type.limit &gt; 0</code><br>
   + field enabled, displayed while count( user_phone) &lt; user_phone_type.limit<br></p>
  
  <p>I feel that this system is potentially viable, though I'm not sure if it's exactly the best way to go around doing this.  Does anyone have any other options to keep the application flexible and database-oriented while maintaining easier relations?  Perhaps some sort of configuration table setup, and we could store the config values in a local variable within the model or controller.</p>