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

3.next - Fix unique constraints getting lost. #967

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

ndm2
Copy link
Contributor

@ndm2 ndm2 commented Dec 22, 2023

When using the first column of the constraints and foreign keys to index the rules array, constraints and foreign keys that share the same first column in the composite constraint will overwrite previously set rules.

Now that is kind of a breaking change for people that are using custom table templates and/or custom model commands, but I don't really see a good way to fix this in a backwards compatible manner without awkward workarounds that will eventually still have pitfalls. Maybe this should rather go in a not yet existent 3.next?

Ideally there would be support for multiple error fields, as setting the error on the first field only is kinda awkward. Any opinions on that?

refs #957

When using the first column of the constraints and foreign keys to
index the rules array, constraints and foreign keys that share the same
first column in the composite constraint will overwrite previously set
rules.

refs #957
@ndm2 ndm2 force-pushed the 3.x-fix-unique-constraints-getting-lost branch from aa4f075 to 07a460a Compare December 22, 2023 16:43
@othercorey
Copy link
Member

3.next does make sense for this and some other feature PRs

@ADmad ADmad changed the base branch from 3.x to 3.next December 24, 2023 05:47
@ndm2 ndm2 changed the title 3.x - Fix unique constraints getting lost. 3.next - Fix unique constraints getting lost. Dec 24, 2023
@dereuromark dereuromark merged commit b5f106f into 3.next Dec 28, 2023
7 of 8 checks passed
@dereuromark dereuromark deleted the 3.x-fix-unique-constraints-getting-lost branch December 28, 2023 08:45
@markstory markstory added this to the 3.x (CakePHP 5) milestone Dec 30, 2023
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.

4 participants