summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2021-10-26Fixed #32672 -- Fixed introspection of primary key constraints on SQLite.Anv3sh
Thanks Simon Charette for the implementation idea.
2021-10-25Fixed #31503 -- Made autodetector remove unique/index_together before ↵David Wobrock
altering fields.
2021-10-22Fixed #33214 -- Added ↵Manaia Junior
BaseDatabaseOperations.format_for_duration_arithmetic() stub method.
2021-10-21Made F deconstruction omit 'expressions' in the path.Adam Johnson
2021-10-19Fixed #33197 -- Made field rename with prior matching db_column change a noop.Simon Charette
Thanks Jacob Walls for the report.
2021-10-18Fixed #33194 -- Fixed migrations when altering a field with functional ↵Hannes Ljungberg
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>
2021-10-15Fixed #23953 -- Made makemigrations continue number sequence for squashed ↵Jacob Walls
migrations.
2021-10-13Refs #25265 -- Allowed Query subclasses to build filters.Erik Cederstrand
2021-10-12Fixed #29470 -- Logged makemigrations automatic decisions in non-interactive ↵Jacob Walls
mode.
2021-10-12Fixed #28401 -- Allowed hashlib.md5() calls to work with FIPS kernels.Ade Lee
md5 is not an approved algorithm in FIPS mode, and trying to instantiate a hashlib.md5() will fail when the system is running in FIPS mode. md5 is allowed when in a non-security context. There is a plan to add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate whether or not the instance is being used in a security context. In the case where it is not, the instantiation of md5 will be allowed. See https://bugs.python.org/issue9216 for more details. Some downstream python versions already support this parameter. To support these versions, a new encapsulation of md5() has been added. This encapsulation will pass through the usedforsecurity parameter in the case where the parameter is supported, and strip it if it is not. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-10-11Refs #32900 -- Restored '[y/N]' in questioner prompt when merging migrations.Seonghyeon Cho
Regression in 02bc7161ec477afd4a7b328936eb8adac078d7b9.
2021-10-06Fixed #33131 -- Improved error messages for clashing reverse accessor names.Bernd Wechner
2021-10-06Fixed #23408 -- Added migrations questioner prompt for adding unique fields ↵Jacob Walls
with a callable default.
2021-10-06Refs #26430 -- Removed unused branch in sql.Query.get_count().Simon Charette
Now that sql.Query.get_aggregation() properly deals with empty result sets summary Count() annotations cannot result in None. Unused since 9f3cce172f6913c5ac74272fa5fc07f847b4e112.
2021-10-01Refs #32943 -- Added support for covering SP-GiST indexes on PostgreSQL 14+.Nick Pope
2021-10-01Fixed #32961 -- Added BitXor() aggregate to django.contrib.postgres.Nick Pope
2021-10-01Fixed #33160 -- Avoided suppressing query errors in _nodb_cursor() on ↵Daniel Hahler
PostgreSQL.
2021-09-30Fixed #33159 -- Reverted "Fixed #32970 -- Changed WhereNode.clone() to ↵Mariusz Felisiak
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.
2021-09-29Fixed #33018 -- Fixed annotations with empty queryset.David Wobrock
Thanks Simon Charette for the review and implementation idea.
2021-09-29Fixed #33141 -- Renamed Expression.empty_aggregate_value to ↵David Wobrock
empty_result_set_value.
2021-09-28Fixed #33033 -- Prevented models.DecimalField from accepting NaN values.Chinmoy Chakraborty
2021-09-28Fixed #33125 -- Avoided redundant unique constraint when converting a ↵Jordan Bae
non-unique field to primary key on MySQL and PostgreSQL.
2021-09-27Refs #32355 -- Used @functools.lru_cache as a straight decorator.Mariusz Felisiak
2021-09-24Fixed #33124 -- Avoided accessing the database connections when not necessary.Keryn Knight
Follow up to bf5abf1bdcedb15e949db419c61eeec7c88414ea. This also caches the __getitem__ access.
2021-09-24Fixed #33127 -- Added error messages on | and & operators with combined ↵Hasan Ramezani
querysets.
2021-09-23Fixed #33133 -- Fixed handling NullBooleanField in historical migrations.Mariusz Felisiak
Regression in d992f4e3c29a81c956d3d616f0bc19701431b26e.
2021-09-22Fixed #33129 -- Dropped support for MariaDB 10.2.Mariusz Felisiak
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