LoginSignup
0
0

More than 5 years have passed since last update.

ridgepoleでutf8_general_ciを指定しているのにutf8mb4の最大文字数エラーにかかった話

Last updated at Posted at 2016-10-10

さいしょに

ridgepoleは何も悪くないです。

事件

[ERROR] Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX `xxxxxx` USING btree ON `xxxxxxx` (`xxxxx`)

というエラーが出た。

t.string   "xxxxx", limit: 255, null: true, collection: "utf8_general_ci"
add_index "xxxxxx", ["xxxxxx"], name: "key_twitter_exts_1", unique: true, using: :btree

と指定しているのでutf_general_ciが使われるはずなのだけど、どうもutf8mb4のままになっているっぽい。

原因

スクリーンショット 2016-10-10 20.03.24.png

うーん…

スクリーンショット 2016-10-10 20.03.30.png

うーん……?

スクリーンショット 2016-10-10 20.03.33.png

あ!!!

タイポ

collectionじゃなくてcollationな。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0