The error message is as follows: pdoexception:sqlstate[42000]: Syntax error or Access violation:1071 Specified key was too long; Max key length is 3072 bytes:create TABLE {start_zero_order} (' ID ' int. unsigned not NULL auto_increment COMMENT ' The Ord ER id. ', ' username ' varchar ($) NOT null COMMENT ' xxx ', ' order ' varchar (4096) null DEFAULT null COMMENT ' xxx. ', PRIMARY KE Y (' id '), UNIQUE KEY ' username ' (' username '), INDEX ' order ' (' Order ')) ENGINE = InnoDB DEFAULT CHARACTER SET UTF8 COMMENT ' The taxi order. '; Array () in db_create_table ()
At this point to unload the module, and then modify the data length, specifically, my database supports the key length is 3072, and the different encoding format each character occupies a different length:
Latin1 = 1 byte = 1 character
Uft8 = 3 byte = 1 character
GBK = 2 byte = 1 character
Therefore, the above SQL statement Light Order field needs length 4096*3=12288 bytes, so the error. Change to 512, reinstall module problem resolution.
A workaround for using Hook_schema to create a database error pdoexception:sqlstate[42000] in Drupal