voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Prevent "index too long" error

Open rickmacgillis opened this issue 3 years ago • 2 comments

This PR fixes the error from issue #5294.

rickmacgillis avatar Apr 18 '21 23:04 rickmacgillis

@rickmacgillis, As you've undoubtedly discovered at this point, your prefix is the cause of the error you're getting. Obviously this problem is not unique to you, but I do have a couple concerns with your solution. I agree that hard-coding a name for that index is likely the correct solution, but we also have to weigh that against the complaints we'll get from users about how it's not using their configured prefix.

Perhaps there's a way to use the configured prefix and a simplified index name to keep it under the 64 character limit. Obviously, a 63 character prefix would still break, but at least that would be consistent across the entire laravel app, not just this one migration.

@emptynick / @MrCrayon, any thoughts?

fletch3555 avatar Apr 19 '21 04:04 fletch3555

I think that would be the right solution: https://github.com/the-control-group/voyager/issues/3751#issuecomment-555580542

Setting the unique-option per column is the same that was intended by bulk-setting this and it doesn't have a problem with the character limit.

pegelf avatar Nov 18 '21 11:11 pegelf