diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py
index b00853b74d..022952a7d4 100644
|
a
|
b
|
class BaseDatabaseSchemaEditor(object):
|
| 971 | 971 | Returns all constraint names matching the columns and conditions |
| 972 | 972 | """ |
| 973 | 973 | if column_names is not None: |
| 974 | | column_names = [ |
| | 974 | column_names = set([ |
| 975 | 975 | self.connection.introspection.column_name_converter(name) |
| 976 | 976 | for name in column_names |
| 977 | | ] |
| | 977 | ]) |
| 978 | 978 | with self.connection.cursor() as cursor: |
| 979 | 979 | constraints = self.connection.introspection.get_constraints(cursor, model._meta.db_table) |
| 980 | 980 | result = [] |
| 981 | 981 | for name, infodict in constraints.items(): |
| 982 | | if column_names is None or column_names == infodict['columns']: |
| | 982 | if column_names is None or column_names == set(infodict['columns']): |
| 983 | 983 | if unique is not None and infodict['unique'] != unique: |
| 984 | 984 | continue |
| 985 | 985 | if primary_key is not None and infodict['primary_key'] != primary_key: |