sea-query
sea-query copied to clipboard
Resolving `IndexCreateStatement` not generating a valid query when no name is provided
On mysql systems, the IndexCreateStatement will generate a name, if no name was provided, resulting in always having a valid statement regarding the name.
PR Info
- Closes https://github.com/SeaQL/sea-orm/discussions/1620
Bug Fixes
- [x] The IndexCreateStatement does not work with mysql, if the name is not provided
Hey @mohs8421, nice stuffs!! Yes, then we always have a proper index name regardless.
@ikrivosheev do you still remember the "bug" where MySQL constraint / index name exceed the maximum length of MySQL's limit? Looks like @mohs8421 just truncate the long name.
well I didn't want to introduce an other source of error, so I just looked up the limit, although I know that this approach is still flawed because it could abreviate more properly, but then again, it is rather unlikely that somebody introduces an index, which exceeds this limit and have two of these indexes on the same table. In that case that user would still be able to manually specify a name, so nothing lost on that end.
Hey @mohs8421, nice stuffs!! Yes, then we always have a proper index name regardless.
@ikrivosheev do you still remember the "bug" where MySQL constraint / index name exceed the maximum length of MySQL's limit? Looks like @mohs8421 just truncate the long name.
@billy1624 hello! Yes, I do. Well, It's makes sense to truncate the long name...