title: Ruby On Rails - Rake schema - Max key length is 767 bytes
body: <p>Im trying to rake db:schema:load but I get the error</p>
  
  <pre><code>Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX 
  </code></pre>
  
  <p>From what I understand is that InnoDB only allows a max of 767 bytes in their index... And if you're using utf-8 it should be divided by 3.</p>
  
  <p>But when i try to set a maximum of 100 characters (its not even close to 767) in the schema.rb the error still occurs...</p>
  
  <p><strong>schema.rb</strong></p>
  
  <pre><code>add_index "friendly_id_slugs", ["slug", "sluggable_type"], :name =&gt; "index_friendly_id_slugs_on_slug_and_sluggable_type", :unique =&gt; true, :length =&gt; { :name =&gt; 100, :slug =&gt; 100, :sluggable_type =&gt; 40 }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>-- add_index("friendly_id_slugs", ["slug", "sluggable_type"], {:name=&gt;"index_friendly_id_slugs_on_slug_and_sluggable_type", :unique=&gt;true, :length=&gt;{:name=&gt;100, :slug=&gt;100, :sluggable_type=&gt;40}})
  rake aborted!
  Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX `index_friendly_id_slugs_on_slug_and_sluggable_type` ON `friendly_id_slugs` (`slug`, `sluggable_type`)
  </code></pre>
  
  <p><strong>MySQL</strong></p>
  
  <pre><code>Your MySQL connection id is 1838
  Server version: 5.5.22-0ubuntu1-log (Ubuntu)
  </code></pre>
  
  <p>What am I missing?  </p>