Opened 20 hours ago

Last modified 16 hours ago

#36808 assigned Cleanup/optimization

Make UniqueConstraint name required in signature

Reported by: Jonathan Biemond Owned by: Jonathan Biemond
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Jonathan Biemond Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

A UniqueConstraint requires a name argument, but is declared optional (=None) in its signature. If name is omitted a ValueError is raised. This may be confusing to developers.

The name argument was first made optional in the signature in commit [3aa545281], which introduced support for functional unique constraints, addressing ticket #30016.

More discussion on the forum: https://forum.djangoproject.com/t/make-uniqueconstraint-name-required-in-signature/43664

Change History (3)

comment:1 by Jonathan Biemond, 20 hours ago

Has patch: set

comment:2 by Jacob Walls, 18 hours ago

Triage Stage: UnreviewedAccepted
Version: 6.0dev

Thanks. #36262 is a related ticket as Clifford pointed out on the forum.

comment:3 by Jacob Walls, 16 hours ago

Triage Stage: AcceptedReady for checkin
Note: See TracTickets for help on using tickets.
Back to Top