问题
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