1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #32770 -- Added system check to ensure django.contrib.postgres is installed when using its features.

Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS
when using:
* PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField),
* PostgreSQL indexes (PostgresIndex and all subclasses), and
* ExclusionConstraint

The check provides immediate feedback during system checks rather than failing
later with obscure runtime and database errors.

Thanks to Simon Charette and Sarah Boyce for reviews.
This commit is contained in:
Clifford Gama
2025-05-16 23:48:38 +02:00
committed by Sarah Boyce
parent 8c56e93975
commit 74b31cd26b
12 changed files with 197 additions and 12 deletions

View File

@@ -247,6 +247,7 @@ def setup_collect_tests(start_at, start_after, test_labels=None):
settings.LOGGING = log_config
settings.SILENCED_SYSTEM_CHECKS = [
"fields.W342", # ForeignKey(unique=True) -> OneToOneField
"postgres.E005", # django.contrib.postgres must be installed to use feature.
]
# Load all the ALWAYS_INSTALLED_APPS.