Mysql::Error: Specified key was too long; max key length is 767 bytes: CREATE INDEX

后端 未结 5 1512
时光说笑
时光说笑 2020-12-06 05:48

I\'m working with rails 2.3.5 application, in witch I have this field

t.string   \"trip_cities\",             :limit => 256

And this ind

5条回答
  •  攒了一身酷
    2020-12-06 06:19

    Set a limit on the length of the string to 191 characters, example:

    t.string :project, index: { unique: true }, limit: 191
    

    OR

    Use this patch: https://github.com/rails/rails/issues/9855#issuecomment-390366184

提交回复
热议问题