Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion django/db/backends/postgresql/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ def get_constraints(self, cursor, table_name):
cl.reloptions
FROM pg_constraint AS c
JOIN pg_class AS cl ON c.conrelid = cl.oid
WHERE cl.relname = %s AND pg_catalog.pg_table_is_visible(cl.oid)
WHERE cl.relname = %s
AND pg_catalog.pg_table_is_visible(cl.oid)
AND c.contype != 'n'
""",
[table_name],
)
Expand Down
1 change: 1 addition & 0 deletions tests/migrations/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def assertIndexExists(
.values()
if (
c["columns"] == list(columns)
and c["index"] is True
and (index_type is None or c["type"] == index_type)
and not c["unique"]
)
Expand Down