This is already something we must handle when using `DEFAULT` to add
fields with a `default` so all the backend specific logic lives in in
`_column_default_sql` so it's only a matter of using it in
`db_default_sql`.
--
Ticket URL: <https://code.djangoproject.com/ticket/35162>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/35162#comment:1>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/35162#comment:2>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"dfc77637ea5c1aa81caa72b1cf900e6931d61b54" dfc77637]:
{{{#!CommitTicketReference repository=""
revision="dfc77637ea5c1aa81caa72b1cf900e6931d61b54"
Fixed #35162 -- Fixed crash when adding fields with db_default on MySQL.
MySQL doesn't allow literal DEFAULT values to be used for BLOB, TEXT,
GEOMETRY or JSON columns and requires expression to be used instead.
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35162#comment:3>
In [changeset:"3e7a30fb3a5ea38d06bbedd53e2130bf192425c7" 3e7a30fb]:
{{{#!CommitTicketReference repository=""
revision="3e7a30fb3a5ea38d06bbedd53e2130bf192425c7"
[5.0.x] Fixed #35162 -- Fixed crash when adding fields with db_default on
MySQL.
MySQL doesn't allow literal DEFAULT values to be used for BLOB, TEXT,
GEOMETRY or JSON columns and requires expression to be used instead.
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
Backport of dfc77637ea5c1aa81caa72b1cf900e6931d61b54 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35162#comment:4>