summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2021-12-06[4.0.x] Fixed #33335 -- Made model validation ignore functional unique ↵Hannes Ljungberg
constraints. Regression in 3aa545281e0c0f9fac93753e3769df9e0334dbaa. Thanks Hervé Le Roy for the report. Backport of 1eaf38fa87384fe26d1abf6e389d6df1600d4d8c from main
2021-12-03[4.0.x] Fixed #33333 -- Fixed setUpTestData() crash with models.BinaryField ↵Mariusz Felisiak
on PostgreSQL. This makes models.BinaryField pickleable on PostgreSQL. Regression in 3cf80d3fcf7446afdde16a2be515c423f720e54d. Thanks Adam Zimmerman for the report. Backport of 2c7846d992ca512d36a73f518205015c88ed088c from main.
2021-11-12[4.0.x] Fixed #33279 -- Fixed handling time zones with "-" sign in names.Can Sarigol
Thanks yakimka for the report. Regression in fde9b7d35e4e185903cc14aa587ca870037941b1. Backport of 661316b066923493ff91d6d2aa92e463f595a6b1 from main.
2021-11-02[4.0.x] Fixed #33234 -- Fixed autodetector crash for proxy models inheriting ↵Mariusz Felisiak
from non-model class. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42. Thanks Kevin Marsh for the report. Backport of dab48b7482295956973879d15bfd4d3bb0718772 from main
2021-10-25[4.0.x] Fixed #31503 -- Made autodetector remove unique/index_together ↵David Wobrock
before altering fields. Backport of 0314593fe8e7dc685bbb6585eee40e755588864e from main
2021-10-18[4.0.x] Fixed #33194 -- Fixed migrations when altering a field with ↵Hannes Ljungberg
functional indexes/unique constraints on SQLite. This adjusts Expressions.rename_table_references() to only update alias when needed. Regression in 83fcfc9ec8610540948815e127101f1206562ead. Co-authored-by: Simon Charette <charettes@users.noreply.github.com> Backport of 86971c40909430a798e4e55b140004c4b1fb02ff from main
2021-10-11[4.0.x] Refs #32900 -- Restored '[y/N]' in questioner prompt when merging ↵Seonghyeon Cho
migrations. Regression in 02bc7161ec477afd4a7b328936eb8adac078d7b9. Backport of aa0d796e37c4b8056148de2f68726aae9d20399c from main
2021-10-01[4.0.x] Fixed #33160 -- Avoided suppressing query errors in _nodb_cursor() ↵Daniel Hahler
on PostgreSQL. Backport of 98c8bf1ceeab5c68751c83555f82cff1a9120a67 from main
2021-09-30[4.0.x] Fixed #33159 -- Reverted "Fixed #32970 -- Changed WhereNode.clone() ↵Mariusz Felisiak
to create a shallow copy of children." This reverts commit e441847ecae99dd1ccd0d9ce76dbcff51afa863c. A shallow copy is not enough because querysets can be reused and evaluated in nested nodes, which shouldn't mutate JOIN aliases. Thanks Michal Čihař for the report. Backport of 903aaa35e5ceaa33bfc9b19b7f6da65ce5a91dd4 from main
2021-09-29[4.0.x] Fixed #33018 -- Fixed annotations with empty queryset.David Wobrock
Thanks Simon Charette for the review and implementation idea. Backport of dd1fa3a31b4680c0d3712e6ae122b878138580c7 from main
2021-09-29[4.0.x] Fixed #33141 -- Renamed Expression.empty_aggregate_value to ↵David Wobrock
empty_result_set_value. Backport of ad36a198a12df4dff65992191b3eb0a474e2daac from main
2021-09-28[4.0.x] Fixed #33033 -- Prevented models.DecimalField from accepting NaN values.Chinmoy Chakraborty
Backport of b7fd668b37341fc92d67c4854c4f244e10895c9b from main
2021-09-23[4.0.x] Fixed #33133 -- Fixed handling NullBooleanField in historical ↵Mariusz Felisiak
migrations. Regression in d992f4e3c29a81c956d3d616f0bc19701431b26e. Backport of 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 from main
2021-09-20Refs #27624 -- Optimized Query.clone() for non-combined queries.Keryn Knight
This avoids constructing a generator expression and a new tuple if the Query has no combined queries.
2021-09-20Fixed #32970 -- Changed WhereNode.clone() to create a shallow copy of children.Keryn Knight
2021-09-17Refs #27624 -- Changed Query.explain_info to namedtuple.Adam Johnson
2021-09-17Optimized Query.clone() a bit.Adam Johnson
This removes unnecessary "if ... is None" branches, which are already shallow-copied in the __dict__.copy() call.
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-09-09Fixed #33084 -- Removed incorrect system check for ManyToManyField with ↵Hasan Ramezani
limit_choices_to.
2021-09-01Fixed #33073 -- Fixed queryset crash with aggregation and empty/extra ↵David Wobrock
queryset annotation.
2021-09-01Fixed #33080 -- Preserved nullability of textual fields on Oracle.Mariusz Felisiak
Thanks Matt Hoskins for the report.
2021-08-31Fixed #33057 -- Fixed recreation of foreign key constraints in m2m tables ↵Mariusz Felisiak
when altering type of referenced primary key on Oracle.
2021-08-30Fixed #24900 -- Allowed migrating backward to squashed migrations.Jacob Walls
2021-08-27Fixed #32900 -- Improved migrations questioner prompts.Mateo Radman
2021-08-26Refs #29898 -- Changed fields in ProjectState's relation registry to dict.Mariusz Felisiak
2021-08-25Refs #29898 -- Made ProjectState encapsulate alterations in relations registry.Manav Agarwal
Thanks Simon Charette and Chris Jerdonek for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-08-24Refs #10929 -- Allowed NowUTC SQL customization for third-party backends.Tim Graham
2021-08-20Refs #29898 -- Refactored out ↵Manav Agarwal
ProjectState.resolve_model_relations()/resolve_model_field_relations() hooks.
2021-08-20Fixed #33017 -- Fixed storage engine introspection on MySQL.Matjaz Gregoric
This also improves performance on MySQL instances with a large number of databases, since querying the information_schema table can be very slow
2021-08-20Optimized DatabaseSchemaEditor._field_should_be_indexed() on MySQL.Matjaz Gregoric
2021-08-19Fixed #33025 -- Avoided accessing the database connections in ↵Keryn Knight
Query.build_lookup() when not necessary. Of the built-in backends, only Oracle treats empty strings and nulls as equal, so avoid testing the default connection backend for interprets_empty_strings_as_nulls if it can be established from the lookup that it wouldn't affect the lookup instance returned. This improves performance a small amount for most lookups being built, because accessing the connections requires touching the thread critical `Local` which is an expensive operation.
2021-08-19Fixed #33014 -- Made ProjectState raise exception when real_apps argument is ↵Chris Jerdonek
not a set.
2021-08-11Refs #29898 -- Changed ProjectState.real_apps to set.Mariusz Felisiak
2021-08-09Removed unnecessary WhereNode.is_summary.Mariusz Felisiak
Unnecessary since its introduction in 1df89a60c5b7a28d7fda4c9ba7c07f02fd7de0fa.
2021-08-09Fixed #33003 -- Removed **kwargs from QuerySet._chain().Keryn Knight
The functionality of updating the __dict__ was only present to allow for pickling a Prefetch object, which is a comparably rare operation. Forcing the __getstate__() implementation to handle it allows the chaining operation to be slightly faster, which is much more common.
2021-08-06Fixed #32983 -- Added system check for redundant related_name on symmetrical ↵Nick Touran
M2M fields. Since ManyToManyFields defined with `symmetrical=True` do not add a related field to the target model, including a `related_name` argument will never do what the coder likely expects. This makes including a related_name with a symmetrical model raise a system check warning. ticket-32983
2021-08-04Fixed typos in migrations tests, comments, and error message.Jacob Walls
2021-07-30Refs #32966 -- Refactored out DateTimeCheckMixin._check_if_value_fixed().Chris Jerdonek
2021-07-30Refs #32966 -- Simplified the _check_fix_default_value() implementations.Chris Jerdonek
2021-07-30Refs #32966 -- Added _to_naive() and _get_naive_now() for use in ↵Chris Jerdonek
DateTimeCheckMixin classes.
2021-07-30Fixed #32966 -- Fixed TimeField.check() crash for timezone-aware times in ↵Chris Jerdonek
default when USE_TZ = True.
2021-07-28Refs #32946 -- Changed internal usage of dynamic Q() objects construction to ↵Keryn Knight
use non-kwargs initialization. This prefers non-kwargs construction of dynamically generated Q() objects to create a single Q() object instead of many and then combining them, where possible.
2021-07-28Refs #32946 -- Changed Query.add_filter() to take two arguments.Keryn Knight
2021-07-28Optimized BaseDatabaseSchemaEditor._effective_default() a bit,Chris Jerdonek
This eliminates an unneeded call to datetime.now() when field.get_internal_type() equals "DateTimeField".
2021-07-27Refs #32962 -- Simplified NULL logic in ↵Chris Jerdonek
BaseDatabaseSchemaEditor._iter_column_sql().
2021-07-27Fixed #32962 -- Consolidated string concatenations in ↵Chris Jerdonek
BaseDatabaseSchemaEditor.column_sql().
2021-07-27Refs #32956 -- Changed "afterwards" to "afterward" in docs and comments.David Smith
This also removes unnecessary comments with the previous spelling. AP Stylebook has a short entry to advise the preferred spelling for "en-us". "Afterwards" is preferred in British English.
2021-07-27Refs #32743 -- Fixed recreation of foreign key constraints when altering ↵Jordan Bae
type of referenced primary key with MTI. Follow up to 325d7710ce9f6155bb55610ad6b4580d31263557.
2021-07-26Fixed #32743 -- Added foreign key altering when altering type of referenced ↵David Wobrock
primary key with MTI.
2021-07-26Fixed #32947 -- Fixed hash() crash on reverse M2M relation when ↵Tom Wojcik
through_fields is a list. Regression in c32d8f33d8e988a376e44997b8f3606d821f305e.