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

MySQL 5.6 support #178

Nemo64 opened this issue Mar 26, 2020 · 0 comments · Fixed by DamienHarper/auditor#3

MySQL 5.6 support #178

Nemo64 opened this issue Mar 26, 2020 · 0 comments · Fixed by DamienHarper/auditor#3
bug Something isn't working


Copy link

Nemo64 commented Mar 26, 2020

DoctrineAuditBundle version 3.3.2
PHP version 7.3.14
Database MySQL 5.6.47 (ORM version 2.7.0)


The the Indexes on object_id, discriminator and blame_id are too long for MySQL 5.6.

Current behavior

In strict mode I'll get an error: Specified key was too long; max key length is 767 bytes.
In normal mode MySQL will truncate the index to eg. object_id(191) which is fine, but every time I create a migration dbal will try to migrate from object_id(191) to just object_id.

This is actually an issue with dbal: doctrine/dbal#3419
But that issue is so old that probably nobody cares about it and the most simple fix could be within the schema here even though it's a bit of a hack

How to reproduce

Just use MySQL 5.6. I recommend the docker image.

Expected behavior

Not that easy. Either the index must always be shortened to 191 or there must be a detection for mysql 5.6 in place.

Another alternative would be to not encode the existing fields with utf8 but in binary since text feature are not really required here but that would change the schema for everyone already using this bundle

The reason I care for that old MySQL is because I use AWS Aurora Serverless which is only 5.6 compatible. But my local testing runs on a real MySQL 5.6.47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
bug Something isn't working
None yet

Successfully merging a pull request may close this issue.

2 participants