summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2024-07-23 00:33:31 -0400
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-07-25 07:51:45 +0200
commitd8116bf7f56930a95926444c625ca786f2f534ce (patch)
tree1d5dce7236e96c3b4830428098335f1853ace310 /docs
parent249f2fd423f4d892f647117cf20b06772e1f3e25 (diff)
[5.1.x] Fixed #35625 -- Fixed a crash when adding a field with db_default and check constraint.
This is the exact same issue as refs #30408 but for creating a model with a constraint containing % escapes instead of column addition. All of these issues stem from a lack of SQL and parameters separation from the BaseConstraint DDL generating methods preventing them from being mixed with other parts of the schema alteration logic that do make use of parametrization on some backends (e.g. Postgres, MySQL for DEFAULT). Prior to the addition of Field.db_default and GeneratedField in 5.0 parametrization of DDL was never exercised on model creation so this is effectively a bug with db_default as the GeneratedField case was addressed by refs #35336. Thanks Julien Chaumont for the report and Mariusz Felisiak for the review. Backport of f359990e4909db8722820849d61a6f5724338723 from main.
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/5.0.8.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/releases/5.0.8.txt b/docs/releases/5.0.8.txt
index 1037b78f75..7bdb5488b2 100644
--- a/docs/releases/5.0.8.txt
+++ b/docs/releases/5.0.8.txt
@@ -15,3 +15,7 @@ Bugfixes
* Fixed a regression in Django 5.0 where ``ModelAdmin.action_checkbox`` could
break the admin changelist HTML page when rendering a model instance with a
``__html__`` method (:ticket:`35606`).
+
+* Fixed a crash when creating a model with a ``Field.db_default`` and a
+ ``Meta.constraints`` constraint composed of ``__endswith``, ``__startswith``,
+ or ``__contains`` lookups (:ticket:`35625`).