Allow customizing ValidationError code in UniqueConstraint
This is based on @xafer's PR. It was a follow-up to #34338.
Since violation_error_code could never be defined for UniqueConstraint prior to #16560 there is no backward compatibility to bother with.
But if the user bothered to provide a violation_error_code to its UniqueConstraint it is likely expecting it to be used.
I think it makes sense given that we now allow more customization of these constraints to allow customizing the violation_error_code as well.
Change History
(9)
| Summary: |
Allowed customizing ValidationError code in UniqueConstraint → Allow customizing ValidationError code in UniqueConstraint
|
| Owner: |
set to Md. Saikat Islam
|
| Status: |
new → assigned
|
| Triage Stage: |
Unreviewed → Accepted
|
| Type: |
Uncategorized → New feature
|
| Has patch: |
set
|
| Needs tests: |
set
|
| Owner: |
Md. Saikat Islam removed
|
| Status: |
assigned → new
|
| Owner: |
set to Ashish Patnaik
|
| Status: |
new → assigned
|
After inspecting the codebase,
CheckConstraintandExclusionConstraintalready fully support customizingviolation_error_code. SoUniqueConstraintshould allow customizing ValidationError Code.