summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2020-05-28Fixed #31468 -- Allowed specifying migration filename in Operation.Adam Johnson
This adds also suggested filename for many built-in operations.
2020-05-27Fixed #31606 -- Allowed using condition with lookups in When() expression.Ryan Heard
2020-05-26Fixed #31614 -- Fixed aliases ordering by OrderBy() expressions of combined ↵Laurent Tramoy
queryset.
2020-05-26Fixed #31416 -- Made autodetector find dependencies for MTI model creation ↵Nan Liu
on base fields removal. Removing a base field must take place before adding a new inherited model that has a field with the same name.
2020-05-25Fixed #31624 -- Avoided subquery usage on QuerySet.all().delete().Simon Charette
Thanks Adam Johnson for the report. Regression in 7acef095d73322f45dcceb99afa1a4e50b520479.
2020-05-21Fixed #30375 -- Added FOR NO KEY UPDATE support to ↵Manuel Weitzman
QuerySet.select_for_update() on PostgreSQL.
2020-05-20Fixed #31410 -- Added system checks for invalid model field names in ↵Hasan Ramezani
UniqueConstraint.
2020-05-19Fixed #31607 -- Fixed evaluated Subquery equality.Mariusz Felisiak
Regression in 691def10a0197d83d2d108bd9043b0916d0f09b4.
2020-05-19Fixed #31578 -- Dropped support for MySQL 5.6.Mariusz Felisiak
2020-05-18Refs #12990 -- Added DatabaseFeatures.has_json_operators.Tim Graham
CockroachDB also has them.
2020-05-14Fixed #31584 -- Fixed crash when chaining values()/values_list() after ↵Mariusz Felisiak
Exists() annotation and aggregation on Oracle. Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in the GROUP BY clause. Regression in efa1908f662c19038a944129c81462485c4a9fe8.
2020-05-14Fixed #31568 -- Fixed alias reference when aggregating over multiple subqueries.Simon Charette
691def10a0197d83d2d108bd9043b0916d0f09b4 made all Subquery() instances equal to each other which broke aggregation subquery pushdown which relied on object equality to determine which alias it should select. Subquery.__eq__() will be fixed in an another commit but Query.rewrite_cols() should haved used object identity from the start. Refs #30727, #30188. Thanks Makina Corpus for the report.
2020-05-14Fixed #31566 -- Fixed aliases crash when chaining values()/values_list() ↵Simon Charette
after annotate() with aggregations and subqueries. Subquery annotation references must be resolved if they are excluded from the GROUP BY clause by a following .values() call. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Thanks Makina Corpus for the report.
2020-05-14Fixed #31579 -- Dropped support for PostgreSQL 9.5 and PostGIS 2.2.Mariusz Felisiak
2020-05-13Fixed #31580 -- Added error messages on distinct() following union(), ↵Hasan Ramezani
intersection(), and difference().
2020-05-11Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne
The method has been available since Python 3.6. The shorter syntax is also marginally faster.
2020-05-11Optimized Model and QuerySet pickling version comparison.Adam Johnson
2020-05-08Fixed #12990, Refs #27694 -- Added JSONField model field.sage
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-05-08Refs #12990 -- Bumped mysqlclient requirement to >= 1.4.0.Mariusz Felisiak
MySQLdb.constants.FIELD_TYPE.JSON was added in mysqlclient 1.4.0rc2.
2020-05-06Fixed a/an typos in "SQL" usage.Adam Johnson
2020-05-05Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms.Mariusz Felisiak
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e. Thanks Simon Meers for the report.
2020-05-04Refs #30573 -- Rephrased "Of Course" and "Obvious(ly)" in documentation and ↵Adam Johnson
comments.
2020-04-30Fixed #20581 -- Added support for deferrable unique constraints.Ian Foote
2020-04-27Removed unnecessary tuple wrapping of single format string argument.François Freitag
2020-04-24Refs #31369 -- Deprecated models.NullBooleanField in favor of ↵Tim Schilling
BooleanField(null=True).
2020-04-24Refs #30913 -- Added BaseDatabaseSchemaEditor._index_condition_sql().Hannes Ljungberg
2020-04-23Fixed #29224 -- Fixed removing index_together indexes if exists ↵David Wobrock
unique_together constraint on the same fields.
2020-04-23Fixed #31500 -- Fixed detecting of unique fields in QuerySet.in_bulk() when ↵Hannes Ljungberg
using Meta.constraints. Detection of unique fields now takes into account non-partial unique constraints.
2020-04-22Avoided unnecessary recompilation of ordering clause regex in SQLCompiler.Adam Johnson
2020-04-22Fixed #31499 -- Stored ModelState.fields into a dict.Simon Charette
This allows the removal of its O(n) .get_field_by_name method and many other awkward access patterns. While fields were initially stored in a list to preserve the initial model definiton field ordering the auto-detector doesn't take field ordering into account and no operations exists to reorder fields of a model. This makes the preservation of the field ordering completely superflous because field reorganization after the creation of the model state wouldn't be taken into account.
2020-04-22Refs #31499 -- Ignored field ordering to determine ModelState equality.Simon Charette
2020-04-21Fixed #31479 -- Added support to reset sequences on SQLite.Jon Dufresne
2020-04-21Refs #30591 -- Adjusted table rebuild for non-pk relationship on SQLite.Simon Charette
The existing code was only accounting for primary key changes and not all unique key fields that can be referenced.
2020-04-21Fixed #31064 -- Recreated auto-created many-to-many tables on primary key ↵Simon Charette
data type change on SQLite. Both local and remote auto-created many-to-many relationships were affected.
2020-04-20Stopped rebuilding referenced tables multiple times on SQLite alterations.Simon Charette
2020-04-20Capitalized Unicode in docs, strings, and comments.Jon Dufresne
2020-04-20Fixed #31474 -- Made QuerySet.delete() not return the number of deleted ↵Hasan Ramezani
objects if it's zero.
2020-04-20Fixed #31477 -- Removed "using" argument from ↵Jon Dufresne
DatabaseOperations.execute_sql_flush().
2020-04-20Fixed #24559 -- Made MigrationLoader.load_disk() catch more specific ↵Jon Dufresne
ModuleNotFoundError. Avoids inspecting the exception message, which is not considered a stable API and can change across Python versions. ModuleNotFoundError was introduced in Python 3.6. It is a subclass of ImportError that is raised when the imported module does not exist. It is not raised for other errors that can occur during an import. This exception instance has the property "name" which holds the name of module that failed to import.
2020-04-17Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on ↵Jon Dufresne
PostgreSQL. The sql_flush() positional argument sequences is replaced by the boolean keyword-only argument reset_sequences. This ensures that the old function signature can't be used by mistake when upgrading Django. When the new argument is True, the sequences of the truncated tables will reset. Using a single boolean value, rather than a list, allows making a binary yes/no choice as to whether to reset all sequences rather than a working on a completely different set.
2020-04-17Simplified DatabaseOperations.sql_flush() on Oracle and PostgreSQL.Jon Dufresne
Added early return to decrease an indentation level.
2020-04-17Refs #26552 -- Made reloading the database for tests check only loaded ↵Mariusz Felisiak
tables constraints.
2020-04-15Fixed #31223 -- Added __class_getitem__() to Manager and QuerySet.sobolevn
2020-04-14Fixed #29501 -- Allowed dbshell to pass options to underlying tool.Adam Johnson
2020-04-10Fixed #31351 -- Added system checks for partial indexes and unique ↵Ichlasul Affan
constraints support.
2020-04-10Refs #28305 -- Consolidated field referencing detection in migrations.Simon Charette
This moves all the field referencing resolution methods to shared functions instead of duplicating efforts amongst state_forwards and references methods.
2020-04-09Refs #31411 -- Used RENAME COLUMN on MySQL 8.0.4+.Mariusz Felisiak
MySQL 8.0.3 added support for this syntax but also imposed a restriction against ALTER TABLE RENAME on tables in a foreign key relationship if a LOCK TABLES was active which has been lifted in MySQL 8.0.4+.
2020-04-09Replaced ModelTuple by a model resolving function and bare tuples.Simon Charette
ModelTuple made handling of app_label=None easier but it isn't necessary anymore.
2020-04-09Replaced Operation._get_model_tuple() by ModelTuple.from_model().Simon Charette
This method predated the introduction of ModelTuple and had a single use.
2020-04-09Made Operation.references_model/references_field require app_label.Simon Charette
This will allow them to drop a ton of logic to deal with null app_label.