Syntax error or access violation: 1059 Identifier name is too long

六眼飞鱼酱① 提交于 2019-12-08 14:36:00

问题


I receive a MySQL error when I create a table:

SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name 'FK_SALES_FLAT_CREDITMEMO_GRID_ARCHIVE_STORE_ID_CORE_STORE_STORE_ID' is too long

How can the default Identifier name size be increased or how can I solve this otherwise?


回答1:


Please take a look at http://dev.mysql.com/doc/refman/5.5/en/identifiers.html - you are limited to 64 chars to an identifier.




回答2:


Provide your own shot name to key.

$table->unique(['product_id', 'company_id', 'price', 'delivery_hours'], 'prices_history_index_unique');


来源:https://stackoverflow.com/questions/13133517/syntax-error-or-access-violation-1059-identifier-name-is-too-long

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!