summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2019-10-09Refs #26608 -- Fixed DatabaseFeatures.supports_frame_range_fixed_distance on ↵Mariusz Felisiak
SQLite 3.28+, MariaDB 10.2+, and MySQL 8.0.2+.
2019-10-09Fixed #30860 -- Disabled unneeded NULLS FIRST/LAST workaround on SQLite 3.30+.Simon Charette
2019-10-09Fixed #30856 -- Combined fast-delete queries by model during cascade deletion.Simon Charette
Reduced the number of queries required when performing cascade deletion for a model referenced multiple time by another one by performing an union of reference lookups.
2019-10-09Made Collector.collect() return immediately for disabled related collection.Simon Charette
2019-10-09Used defaultdict in deletion.Collector.Simon Charette
2019-10-03Refs #27914 -- Fixed serialization of nested enum.Enum classes in migrations.Hasan Ramezani
2019-10-02Removed redundant names in django.db.models.functions.__all__.Mariusz Felisiak
2019-10-02Fixed #30821 -- Added ExtractIsoWeekYear database function and iso_week_day ↵Anatol Ulrich
lookup.
2019-10-01Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU
implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
2019-10-01Fixed typo in BulkInsertMapper constant name.Mariusz Felisiak
2019-10-01Fixed #30510 -- Fixed crash of QuerySet.bulk_create() with mixed-length ↵Ahmet Kucuk
texts on Oracle. Text with more than 4000 characters must be set to as a CLOB on Oracle what caused a mixed datatype error (ORA-01790) when shorter text appeared in the same operation.
2019-09-30Fixed #30774 -- Made serialization in migrations use members names for Enums.Hasan Ramezani
2019-09-27Fixed #30798 -- Fixed Meta.ordering validation for pk of related fields.Hasan Ramezani
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.
2019-09-27Refs #30798 -- Prevented chaining fields from the same related model ↵Hasan Ramezani
multiple times in model Meta.ordering.
2019-09-25Fixed #30800 -- Fixed migrations crash when altering a field with custom ↵Mariusz Felisiak
db_type(). Regression in 1378d665a1c85897d951f2ca9618b848fdbba2e7.
2019-09-24Removed some outdated backwards compatibility imports and misleading comments.Mads Jensen
EmptyResultSet moved in 46509cf13dbf049f75077981c29ef2c60b5a96ab. FieldDoesNotExist moved in 8958170755b37ce346ae5257c1000bd936faa3b0. BoundField and pretty_name moved in 8550161e531a603d57723850fb09c4c9b7ca60b9. EMPTY_VALUES moved in 471596fc1afcb9c6258d317c619eaf5fd394e797. BaseRunserverCommand moved in 5c53e30607014163872e89c221b206992a9acfef.
2019-09-24Refs #29444 -- Removed redundant ↵Mariusz Felisiak
DatabaseFeatures.can_return_multiple_columns_from_insert. Unnecessary since b31e63879eb5d9717e9f890401f7222e4f00c910.
2019-09-24Fixed #29444 -- Allowed returning multiple fields from INSERT statements on ↵Johannes Hoppe
Oracle.
2019-09-24Fixed #30796 -- Prevented select_related() from mutating a queryset on chaining.Simon Charette
Thanks Darren Maki for the report.
2019-09-23Fixed #13296 -- Fixed ordering by Options.order_with_respect_to after ↵Hasan Ramezani
deleting objects. Thanks Simon Meers for the original patch.
2019-09-23Fixed #29915 -- Added support for values with hyphens to pattern lookups for ↵Ian Foote
UUIDField on backends without UUID datatype. Support hyphens in iexact, contains, icontains, startswith, istartswith, endswith and iendswith UUIDField filters on backends without UUID datatype.
2019-09-20Fixed #30771 -- Fixed exact lookup against queries with selected columns.James Timmins
Use pre-existing select fields (and thereby GROUP BY fields) from subquery if they were specified, instead of always defaulting to pk. Thanks Aur Saraf for the report and Simon Charette for guidance.
2019-09-20Fixed #30786 -- Used CONVERT_TZ to check if the time zone definitions are ↵Andrew
installed on MySQL. Replaced a timezone check in the MySQL backend with one that doesn't require access to the mysql.time_zone database.
2019-09-11Fixed #30591 -- Fixed recreation of foreign key constraints on MySQL when ↵Adnan Umer
altering type of referenced unique field. Thanks Mariusz Felisiak for tests and Matthijs Kooijman for investigation and initial patch.
2019-09-10Refs #14357 -- Made Meta.ordering not affect GROUP BY queries.Mariusz Felisiak
Per deprecation timeline.
2019-09-10Fixed #30754 -- Prevented inclusion of aliases in partial index conditions.Simon Charette
SQLite doesn't repoint table aliases in partial index conditions on table rename which breaks the documented table alteration procedure. Thanks Pēteris Caune for the report.
2019-09-09Fixed #28107 -- Added ↵Vojtech Bocek
DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models.
2019-09-09Refs #29444 -- Allowed returning multiple fields from INSERT statements on ↵Johannes Hoppe
PostgreSQL. Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and Mariusz Felisiak for reviews.
2019-09-09Refs #29444 -- Fixed DateField constructor in ↵Johannes Hoppe
db.backends.oracle.utils.InsertVar.
2019-09-09Fixed #30757 -- Added a system check to ensure max_length fits the longest ↵Nick Pope
choice.
2019-09-06Fixed DatabaseFeatures.can_introspect_check_constraints on MariaDB < ↵Mariusz Felisiak
10.2.22, 10.3.0 - 10.3.9. Regression in e2c6a0858d7d9ad85eda353076a5b46608b704a9.
2019-09-05Fixed #30750 -- Added support for check constraints on MySQL 8.0.16+.Mariusz Felisiak
2019-09-04Fixed #27910 -- Added enumeration helpers for use in Field.choices.Shai Berger
These classes can serve as a base class for user enums, supporting translatable human-readable names, or names automatically inferred from the enum member name. Additional properties make it easy to access the list of names, values and display labels. Thanks to the following for ideas and reviews: Carlton Gibson, Fran Hrženjak, Ian Foote, Mariusz Felisiak, Shai Berger. Co-authored-by: Shai Berger <shai@platonix.com> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-09-03Fixed #30691 -- Made migrations autodetector find dependencies for foreign ↵Viktor Lomakin
keys altering.
2019-09-03Refs #29444 -- Made db.backends.oracle.utils.InsertVar use str as default.Johannes Hoppe
2019-09-02Fixed #30739 -- Fixed exclusion of multi-valued lookup against outer rhs.Simon Charette
OuterRef right hand sides have to be nested, just like F rhs have to, during the subquery pushdown split_exclude performs to ensure they are resolved against the outer query aliases.
2019-09-02Refs #28442 -- Adjusted related lookups handling of expression rhs.Simon Charette
Expressions should never be prepared as other Lookup.get_prep_lookup implementations hint at by returning early on the presence of the resolve_expression attribute. The previous solution was only handling lookups against related fields pointing at AutoFields and would break for foreign keys to other fields. It was also causing bidirectional coupling between model fields and expressions which the method level import of OuterRef was a symptom of.
2019-08-29Refs #25367 -- Simplified OrderBy and Lookup by using Case() instead of ↵Mariusz Felisiak
RawSQL() on Oracle. Follow up to efa1908f662c19038a944129c81462485c4a9fe8.
2019-08-29Fixed #25367 -- Allowed boolean expressions in QuerySet.filter() and exclude().Matthew Schinckel
This allows using expressions that have an output_field that is a BooleanField to be used directly in a queryset filters, or in the When() clauses of a Case() expression. Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and Adam Johnson for reviews. Co-Authored-By: NyanKiyoshi <hello@vanille.bid>
2019-08-27Fixed #30727 -- Made Subquery pickle without evaluating their QuerySet.Andrew Brown
Subquery expression objects, when pickled, were evaluating the QuerySet objects saved in its _constructor_args attribute.
2019-08-26Refs #30591 -- Fixed introspection of check and unique column constraints on ↵Mariusz Felisiak
MariaDB. Unnamed unique and check columns constraints have the same name as a column. Ensure uniqueness by using custom names. Thanks Adnan Umer for the report.
2019-08-23Replaced subprocess commands by run() wherever possible.Claude Paroz
2019-08-22Fixed #30712 -- Allowed BLOB/TEXT defaults on MySQL 8.0.13+.Nasir Hussain
2019-08-21Fixed #21039 -- Added AddIndexConcurrently/RemoveIndexConcurrently ↵Mads Jensen
operations for PostgreSQL. Thanks to Simon Charettes for review. Co-Authored-By: Daniel Tao <daniel.tao@gmail.com>
2019-08-20Fixed #29979, Refs #17337 -- Extracted AutoField field logic into a mixin ↵Nick Pope
and refactored AutoFields. This reduces duplication by allowing AutoField, BigAutoField and SmallAutoField to inherit from IntegerField, BigIntegerField and SmallIntegerField respectively. Doing so also allows for enabling the max_length warning check and minimum/maximum value validation for auto fields, as well as providing a mixin that can be used for other possible future auto field types such as a theoretical UUIDAutoField.
2019-08-19Fixed #29260 -- Skipped an UPDATE when adding a model instance with primary ↵Hasan Ramezani
key that has a default.
2019-08-18Refs #28428 -- Made FileField.upload_to support pathlib.Path.Claude Paroz
2019-08-17Fixed #29545 -- Fixed using filter lookups againts nested subquery expressions.Simon Charette
Made sql.Where resolve lhs of its child nodes. This is necessary to allow filter lookups against nested subquery expressions to properly resolve their OuterRefs to Cols. Thanks Oskar Persson for the simplified test case.
2019-08-16Fixed #27676 -- Allowed BLOB/TEXT defaults on MariaDB 10.2.1+.Adam Johnson
2019-08-16Fixed #30687 -- Fixed using of OuterRef() expressions in distance lookups.Andrew Brown