title: mysql partition without unique field
body: <p>i want to partition my table.
  the table is:</p>
  
  <pre><code>create_table "multimedia", :force =&gt; true do |t|     
     t.integer   "id"   
     t. binary   "data"    
     t.integer   "device_id"         
     t.datetime  "created_at"                  
  end
  </code></pre>
  
  <p><code>id</code> is the primary key<br>
  created_at is a simple index for the table and there isn't unique</p>
  
  <p>i need to partition the table by the field created_at. In my table there's only record from the last 7 days so i want to partition it by the day. i write this cose:</p>
  
  <pre><code>partition by range (to_days(created_at))          
  
    ( PARTITION p20120417 VALUES LESS THAN (to_days('2012-04-17 23:59:59 +0200')),                   
      PARTITION p20120418 VALUES LESS THAN (to_days('2012-04-18 23:59:59 +0200')),                
      PARTITION p20120419 VALUES LESS THAN (to_days('2012-04-19 23:59:59 +0200')),              
      PARTITION p20120420 VALUES LESS THAN (to_days('2012-04-20 23:59:59 +0200')),               
      PARTITION p20120421 VALUES LESS THAN (to_days('2012-04-21 23:59:59 +0200')),             
      PARTITION p20120422 VALUES LESS THAN (to_days('2012-04-22 23:59:59 +0200')),                  
      PARTITION p20120423 VALUES LESS THAN (to_days('2012-04-23 23:59:59 +0200')),                    
      PARTITION p20120424 VALUES LESS THAN (to_days('2012-04-24 23:59:59 +0200'))                
  );  
  </code></pre>
  
  <p>the code give me this error:</p>
  
  <blockquote>
    <p>A PRIMARY KEY must included all columns in the table's partitioning
    function</p>
  </blockquote>
  
  <p>i need that the table is partition only by created_at and it can't be unique.</p>
  
  <p>How can i do?</p>