voyager
voyager copied to clipboard
Prevent "index too long" error
This PR fixes the error from issue #5294.
@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?
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.