| Age | Commit message (Collapse) | Author |
|
Signed-off-by: JaeHyuck Sa <wogur981208@gmail.com>
|
|
BaseDatabaseSchemaEditor.alter_field().
Regression in f9a44cc0fac653f8e0c2ab1cdfb12b2cc5c63fc2.
Now that ManyToManyField is no longer concrete the decision of whether or not
it should be altered, which is also relied on by field renaming, should take
into consideration name changes even if it doesn't have a column associated
with it, as auto-created many-to-many relationship table names are a base of it.
Note that there is room for optimization here where a rename can be entirely
avoided if ManyToManyField.db_table remains stable between .name changes, just
like we do with Field.db_column remaining stable, but since this is a
regression and meant to be backported the current patch focuses on correctness
over further improvements.
Thanks Josik for the report.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
(23.7+).
Thanks Jacob Walls for the review.
|
|
Thanks Simon Charette for pair programming.
Co-authored-by: Nick Stefan <NickStefan12@gmail.com>
Co-authored-by: Akash Kumar Sen <71623442+Akash-Kumar-Sen@users.noreply.github.com>
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
ManyToManyField was already excluded from fields, concrete_fields,
and local_concrete_fields in Options.
|
|
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
Manually reformatted some long docstrings and comments that would be
damaged by the to-be-applied autofixer script, in cases where editorial
judgment seemed necessary for style or wording changes.
|
|
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
|
|
Thanks Simon Charette for the test.
Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
|
|
This avoids many awkward checks against NOT_PROVIDED and provides symmetry
with Field.has_default() which is also the reason why it wasn't made a
property.
|
|
Thanks Lily Foote and Simon Charette for reviews and mentoring
this Google Summer of Code 2024 project.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Lily Foote <code@lilyf.org>
|
|
True on PostgreSQL."
This reverts commit 9cf9c796be8dd53bc3b11355ff39d65c81d7be6d due to a crash on Oracle
as it didn't allow multiple indexes on the same field.
|
|
PostgreSQL.
|
|
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.
|
|
operation.
|
|
referencing rename field.
Thanks Sarah Boyce for the report and Simon Charette for the
implementation idea.
|
|
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.
|
|
constraints with nulls_distinct.
Bug in 595a2abb58e04caa4d55fb2589bb80fb2a8fdfa1.
Thanks Lucas Lemke Saunitti for the report.
|
|
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.
|
|
This allows for an easier transition of preserving the literal nature of
non-compilable db_default.
|
|
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.
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
Regression in 595a2abb58e04caa4d55fb2589bb80fb2a8fdfa1.
|
|
on SQLite.
Thanks Юрий for the report.
Regression in 78f163a4fb3937aca2e71786fbdd51a0ef39629e.
|
|
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
|
|
|
|
|
|
Thanks Adam Johnson and Paolo Melchiorre for reviews.
Co-Authored-By: Lily Foote <code@lilyf.org>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
with db_table.
|
|
|
|
|
|
|
|
Special thanks to Hannes Ljungberg for finding multiple implementation
gaps.
Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for
reviews.
|
|
|
|
This also fixes test_rename_field_with_check_to_truncated_name() on
MariaDB 10.5.2+ as ALTER TABLE ... RENAME COLUMN statement doesn't
rename inline constraints.
|
|
CheckConstraint if not supported.
The new logic mirrors the logic in SchemaEditor._delete_check_sql()
added in 68ef274bc505cd44f305c03cbf84cf08826200a8.
Thanks Tim Graham for the report.
|
|
columns names.
|
|
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>
|
|
MySQL < 8.0.16.
|
|
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).
|
|
Identified using the following command:
$ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
|
|
ExclusionConstraint.
Regression in 0e656c02fe945389246f0c08f51c6db4a0849bd2.
|
|
Thanks Jack Calvin Brown for the report.
Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
|
|
ArrayField(Char/TextFields).
|
|
DEFAULT_INDEX_TABLESPACE.
Thanks to Simon Charette for locating where issue lay.
|
|
key/unique constraint on the same field.
|
|
|
|
|
|
fields.
Thanks to Rick Yang and Baptiste Mispelon for the investigation.
|