Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

mysql

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?

like image 532
vinoth kumar Avatar asked Oct 30 '12 06:10

vinoth kumar


2 Answers

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.

like image 175
Michael Avatar answered Oct 13 '22 01:10

Michael


Provide your own shot name to key.

$table->unique(['product_id', 'company_id', 'price', 'delivery_hours'], 'prices_history_index_unique');
like image 26
Muzammil Hussain Avatar answered Oct 13 '22 01:10

Muzammil Hussain