geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

innoDB with utf8, ER_TOO_LONG_KEY occured #122

Closed hjin-me closed 10 years ago

hjin-me commented 10 years ago

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

above error occur when

  1. use mysql
  2. autoIncrementId is false
  3. database default charset is utf-8.
  4. the column id is primary key
  5. datatype of id is string

i think should use varchar(255) instead varchar(256) in model / lib / generators / sql.js

mde commented 10 years ago

Fixed in 0b21c5591445acb3b461179fe5bbc88c7eea82b2, pushed to NPM in v0.4.5. Thanks!