1
0
mirror of https://github.com/django/django.git synced 2025-10-09 14:59:24 +00:00

Skipped NOT NULL constraints on PostgreSQL 18+.

Thanks Simon Charette for the implementation idea.
This commit is contained in:
Mariusz Felisiak 2025-09-29 23:09:53 +02:00 committed by GitHub
parent 8b84364d46
commit 906a51e125
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -206,7 +206,9 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
cl.reloptions cl.reloptions
FROM pg_constraint AS c FROM pg_constraint AS c
JOIN pg_class AS cl ON c.conrelid = cl.oid 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], [table_name],
) )