title: How to add Composite primary key in YII Framework
body: <p>I am stuck in creating composite primary key in yii...i have following tables..</p>
  
  <pre><code>**Branche**
  id
  name
  
  **Item**
  id
  name
  
  **branch_item**
  branch_id
  item_id
  </code></pre>
  
  <p>how to create <strong>branch_item</strong> in yii with composite primary key...(and crud with gii)</p>
  
  <p>is it ok if i create table like this...</p>
  
  <pre><code>**branch_item**
  id (this is the primary key)
  branch_id (unique key)
  item_id (unique key)
  </code></pre>
  
  <p>what is the best way create composite id or create id with unique keys...</p>