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

Feat(mysql): improve support for DDL index column constraints #1961

Merged
merged 5 commits into from
Jul 27, 2023

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented Jul 27, 2023

Fixes #1959 -- still a WIP. An alternative I considered for index_options was to create a separate class for each option. That way we'd avoid the if checks in the generator, but we'd have a handful more expression types to deal with, so wasn't sure and went ahead with this approach instead because it felt simple. Will refine & add more tests tomorrow morning.

Reference: https://dev.mysql.com/doc/refman/8.0/en/create-table.html

sqlglot/dialects/mysql.py Outdated Show resolved Hide resolved
@georgesittas georgesittas merged commit d2685dd into main Jul 27, 2023
@georgesittas georgesittas deleted the jo/mysql_index_fixes branch July 27, 2023 16:39
georgesittas added a commit that referenced this pull request Jul 27, 2023
* Feat(mysql): improve support for DDL index column constraints

* Fixup

* Cleanup

* Address comment

* Fix a couple of bugs, add more tests
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

Successfully merging this pull request may close these issues.

getting error for foreign key constrain for mysql
2 participants