oauth-plugin icon indicating copy to clipboard operation
oauth-plugin copied to clipboard

Specified key was too long; max key length is 767 bytes

Open mimosz opened this issue 14 years ago • 3 comments

consumer_tokens table t.string :token, :limit => 1024 # This has to be huge because of Yahoo's excessively large tokens change to : t.string :token, :limit => 128 :( ERROR 1071 (42000): Specified Key was too Long; Max Key Length is 767 Bytes.

mimosz avatar Jun 29 '10 10:06 mimosz

Oops, didn't see it was already posted. I have posted the same issue with a temporary fix.

Dagnan avatar Jul 07 '10 14:07 Dagnan

This is the way to do it in ruby (It maintains the token length as 1024 but restricts the index to 767.

create_table "consumer_tokens", :force => true do |t|

t.integer "person_id" t.string "type", :limit => 30 t.string "token", :limit => 1024 t.string "secret" t.datetime "created_at" t.datetime "updated_at" t.string "account" end

add_index "consumer_tokens", ["token"], :name => "index_consumer_tokens_on_token", :length => {"token"=>"767"}

wakiki avatar Jul 15 '10 14:07 wakiki

Win... thanks for this.

pjammer avatar Feb 01 '11 18:02 pjammer