﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34491	Unable to have constraints with same name on different models	Matheus Cansian	nobody	"PR 11278 (ticket #30396) added system checks to enforce uniqueness of indexes and constraints names. The issue is that (at least for PostgreSQL) the check is too strict. The namespace for table constraints (such as CHECK, UNIQUE, FK) is the table itself. This means that you could have the same name for a constraint if they are on different tables. Unfortunately, this system check prevents you for doing that, forcing you to add the unnecessary ''%(app_label)s_%(class)s'' to every constraint name.

Considering two models (ModelA and ModelB) both with one CheckConstraint with the same name ""test_constraint"". The system check would return the following error:

{{{
?: (models.E032) constraint name 'test_constraint' is not unique among models: app.ModelA, app.ModelB.
}}}


https://github.com/django/django/pull/11278
"	Bug	closed	Core (System checks)	4.2	Normal	wontfix		Simon Charette	Unreviewed	0	0	0	0	0	0
