I wrote migration like this:
create_table :table1 do |t|
t.string :foo, null: false, default: '', limit: 512
t.integer :bar, null: false
t.index [:foo, :bar]
end
and got an error
Mysql2::Error: Specified key was too long; max key length is 767 bytes
How I can resolve this problem, except deŃrease column foo
limit?