A longer term solution is likely to have a better separation of parametrized
DDL altogether to handle checks, constraints, defaults, and generated fields
but such a change would require a significant refactor that isn't suitable
for a backport.
Thanks Adrian Garcia for the report.
Backport of 888b9042b3598bab6557c62de82505eec9ea62ed from main
Bug in 595a2abb58e04caa4d55fb2589bb80fb2a8fdfa1.
Thanks Lucas Lemke Saunitti for the report.
Backport of b98271a6e42107233311d17f5d7bc74fbb47f22c from main
Field.db_default accepts either literal Python values or compilables
(as_sql) and wrap the former ones in Value internally.
While 1e38f11 added support for automatic resolving of output fields for
types such as str, int, float, and other unambigous ones it's cannot do
so for all types such as dict or even contrib.postgres and contrib.gis
primitives.
When a literal, non-compilable, value is provided it likely make the
most sense to bind its output field to the field its attached to avoid
forcing the user to provide an explicit `Value(output_field)`.
Thanks David Sanders for the report.
Backport of e67d7d70fa10c06aca36b9057f82054eda45269d from main
This allows for an easier transition of preserving the literal nature of
non-compilable db_default.
Backport of fe1cb62f5c3f87fafc4a6b52fee2ccc6c80c41e2 from main
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
Thanks Václav Řehák for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
Backport of fcf95e592774a6ededec35481a2061474d467a2b from main.
This should allow smarter output_field inferring in functions dealing
with text expressions.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
Backport of 8b1acc0440418ac8f45ba48e2dfcf5126c83341b from main
Regression in f3f9d03edf17ccfa17263c7efa0b1350d1ac9278 (4.2) and
8ed25d65ea7546fafd808086fa07e7e5bb5428fc (5.0).
Backport of 34b411762b50883d768d7b67e0a158ec39da8b09 from main
Special thanks to Hannes Ljungberg for finding multiple implementation
gaps.
Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for
reviews.
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.
https://github.com/psf/black/releases/tag/23.1.0
Thanks Jared Chung, Tom Carrick, David Smith, Nick Pope, and Mariusz
Felisiak for reviews.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
This moves setting a database collation to the column type alteration
as both must be set at the same time.
This should also avoid another layer of the column type alteration when
adding database comments support (#18468).
Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews.
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>