title: Adding index to bulk number of columns
body: <p>I'm trying to add indexes to 16 columns at a time, in migration:</p>
  
  <pre><code>add_index :billing_invoices, [:due_date, :flat_fee, :percentage_fee, :subtotal, 
  :processing_fee, :total, :invoice_number, :attn, :street_line_1, :street_line_2,
  :city, :state, :zip_code, :is_deactivated, :start_date, :end_date]
  </code></pre>
  
  <p>But, I get this error:</p>
  
  <blockquote>
    <p>Mysql2::Error: Specified key was too long; max key length is 3072
    bytes: CREATE UNIQUE INDEX i ON billing_invoices (due_date,  flat_fee,
    percentage_fee, subtotal, processing_fee, total,  invoice_number,
    attn, street_line_1, street_line_2, city,  state, zip_code,
    is_deactivated, start_date, end_date)</p>
  </blockquote>
  
  <p>So, I tried adding <code>:unique =&gt; true, :name =&gt; 'indexes_billing_invoices'</code>, as it was suggested in a SO post:</p>
  
  <pre><code>add_index :billing_invoices, [:due_date, :flat_fee, :percentage_fee, :subtotal, 
  :processing_fee, :total, :invoice_number, :attn, :street_line_1, :street_line_2,
  :city, :state, :zip_code, :is_deactivated, :start_date, :end_date],
  :unique =&gt; true, :name =&gt; 'indexes_billing_invoices'
  </code></pre>
  
  <p>But, still it throws the same error. Even I tried <code>:name =&gt; 'i'</code> to check, but the same error comes.</p>