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

[5.0.x] Fixed #35638 -- Updated validate_constraints to consider db_default.

Backport of 509763c799 from main.
This commit is contained in:
David Sanders
2024-08-05 08:22:29 +02:00
committed by Sarah Boyce
parent e88ef6a27d
commit 333cfab512
10 changed files with 144 additions and 13 deletions

View File

@@ -128,3 +128,10 @@ class JSONFieldModel(models.Model):
class Meta:
required_db_features = {"supports_json_field"}
class ModelWithDatabaseDefault(models.Model):
field = models.CharField(max_length=255)
field_with_db_default = models.CharField(
max_length=255, db_default=models.Value("field_with_db_default")
)