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

Sort constraints. #45

Merged
merged 2 commits into from
Aug 6, 2023
Merged

Conversation

aslakhellesoy
Copy link
Contributor

@aslakhellesoy aslakhellesoy commented Jul 17, 2023

This is a fix for #44. I decided to sort by multiple struct fields, in the following order:

  • FkSchema
  • FkTable
  • PkSchema
  • PkTable
  • IsPrimary
  • ColumnName
  • HasMultiplePK
  • ConstraintName

This should ensure constraints are consistently sorted.

It would probably have been simpler to write a unit test for the sortConstraints function, but I went with the existing approach instead.

@aslakhellesoy
Copy link
Contributor Author

Hi @KarnerTh - any chance you could have a look at this one?

@KarnerTh
Copy link
Owner

KarnerTh commented Aug 6, 2023

Sorry for the late response - LGTM!

Thanks for the contribution 🙌🏼

@KarnerTh KarnerTh merged commit 65f2af8 into KarnerTh:master Aug 6, 2023
@aslakhellesoy aslakhellesoy deleted the 44-sort-constraints branch August 15, 2023 09:17
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.

2 participants