Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error or access violation: 1059 Identifier name '...' is too long #965

Open
loevgaard opened this issue Dec 17, 2024 · 0 comments
Open

Comments

@loevgaard
Copy link
Contributor

Sylius version affected: 1.*

Description
The maximum length of identifiers in mysql is 64 (https://dev.mysql.com/doc/refman/8.4/en/identifier-length.html). Inside the https://github.com/Sylius/SyliusResourceBundle/blob/1.13/src/Bundle/EventListener/ORMTranslatableListener.php, a unique constraint is created:

$constraints[$metadata->getTableName() . '_uniq_trans'] = [
    'columns' => $columns,
];

This adds 11 characters to the table name and uses that as the unique constraint.

Steps to reproduce
Create a translatable resource with a long table name (54+ characters)

Possible Solution
Use random index names like Doctrine does out of the box or just shorten the constraint name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant