summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2022-03-15Fixed #33552 -- Fixed JSONField has key lookups with numeric keys on ↵Sage Abdullah
MariaDB, MySQL, Oracle, and SQLite.
2022-03-11Fixed #33572 -- Implemented CreateModel/AlterModelManagers reduction.Adam Johnson
2022-03-04Fixed #29865 -- Added logical XOR support for Q() and querysets.Ryan Heard
2022-03-04Refs #31169 -- Prevented infinite loop in tests on failures.Mariusz Felisiak
Regression in ae91ecf6a1037fb67d14841b66ac19d4c2ccc4ac.
2022-03-03Refs #27624 -- Optimized Query.clone() a bit.Keryn Knight
2022-03-03Refs #27624 -- Optimized sql.Query creation by moving immutable/singleton ↵Keryn Knight
attributes to class attributes.
2022-03-02Fixed #33553 -- Used built-in math functions in SQLite 3.35+.Nick Pope
In SQLite 3.35+ some math functions are available built-in as long as they are not disabled at compile time. We can introspect this and use these built-in functions in preference to our slower implementations.
2022-02-26Fixed #33508 -- Fixed DatabaseFeatures.supports_index_column_ordering on ↵Alokik Vijay
MariaDB 10.8+.
2022-02-25Fixed #31486 -- Deprecated passing unsaved objects to related filters.Albert Defler
Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2022-02-23Refs #31169 -- Added DatabaseCreation.setup_worker_connection() hook.Valz
2022-02-22Fixed #19580 -- Unified behavior of reverse foreign key and many-to-many ↵Albert Defler
relations for unsaved instances.
2022-02-22Refs #33517 -- Prevented __second lookup from returning fractional seconds ↵nabil-rady
on PostgreSQL.
2022-02-18Fixed #33379 -- Added minimum database version checks.Hasan Ramezani
Thanks Tim Graham for the review.
2022-02-16Fixed #33515 -- Prevented recreation of migration for ManyToManyField to ↵Mariusz Felisiak
lowercased swappable setting. Thanks Chris Lee for the report. Regression in 43289707809c814a70f0db38ca4f82f35f43dbfd. Refs #23916.
2022-02-16Made Field.error_messages a cached property.Collin Anderson
This speeds up field creation and reduces memory usage.
2022-02-11Refs #32502 -- Avoided table rebuild when removing fields on SQLite 3.35.5+.Mariusz Felisiak
ALTER TABLE ... DROP COLUMN was introduced in SQLite 3.35+ however a data corruption issue was fixed in SQLite 3.35.5.
2022-02-09Fixed #33501 -- Made order_with_respect_to respect database routers.Damian Posener
2022-02-09Fixed #33506 -- Made QuerySet.bulk_update() perform atomic writes against ↵Simon Charette
write database. The lack of _for_write = True assignment in bulk_update prior to accessing self.db resulted in the db_for_read database being used to wrap batched UPDATEs in a transaction. Also tweaked the batch queryset creation to also ensure they are executed against the same database as the opened transaction under all circumstances. Refs #23646, #33501.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-02-07Refs #33482 -- Fixed QuerySet selecting and filtering againts negated ↵Mariusz Felisiak
Exists() with empty queryset. Regression in b7d1da5a62fe4141beff2bfea565f7ef0038c94c.
2022-02-03Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
2022-02-02Fixed #33482 -- Fixed QuerySet filtering againts negated Exists() with empty ↵Simon Charette
queryset. Thanks Tobias Bengfort for the report.
2022-02-01Fixed #33480 -- Fixed makemigrations crash when renaming field of renamed model.Kirill Safronov
Regression in aa4acc164d1247c0de515c959f7b09648b57dc42.
2022-01-31Fixed #33468 -- Fixed QuerySet.aggregate() after annotate() crash on ↵Mariusz Felisiak
aggregates with default. Thanks Adam Johnson for the report.
2022-01-27Fixed #33463 -- Fixed QuerySet.bulk_update() with F() expressions.Jörg Breitbart
2022-01-27Fixed #33462 -- Fixed migration crash when altering type of primary key with ↵Mariusz Felisiak
MTI and foreign key. This prevents duplicated operations when altering type of primary key with MTI and foreign key. Previously, a foreign key to the base model was added twice, once directly and once by the inheritance model. Thanks bcail for the report. Regression in 325d7710ce9f6155bb55610ad6b4580d31263557.
2022-01-25Fixed broken link to cx_Oracle docs.Ian Foote
2022-01-25Refs #20349 -- Avoided loading testing libraries when not needed.Collin Anderson
2022-01-25Fixed #29984 -- Added QuerySet.iterator() support for prefetching related ↵Jacob Walls
objects. Co-authored-by: Raphael Kimmig <raphael.kimmig@ampad.de> Co-authored-by: Simon Charette <charette.s@gmail.com>
2022-01-24Fixed #33460 -- Used VALUES clause for insert in bulk on SQLite.Keryn Knight
SQLite 3.7.11 introduced the ability to use multiple values directly. SQLite 3.8.8 made multiple values not subject to the SQLITE_LIMIT_COMPOUND_SELECT (500).
2022-01-21Fixed #33449 -- Fixed makemigrations crash on models without ↵Fabian Büchler
Meta.order_with_respect_to but with _order field. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42.
2022-01-19Fixed #31685 -- Added support for updating conflicts to QuerySet.bulk_create().sean_c_hsu
Thanks Florian Apolloner, Chris Jerdonek, Hannes Ljungberg, Nick Pope, and Mariusz Felisiak for reviews.
2022-01-17Fixed #29338 -- Allowed using combined queryset in Subquery.Mariusz Felisiak
Thanks Eugene Kovalev for the initial patch, Simon Charette for the review, and Chetan Khanna for help.
2022-01-17Fixed #33435 -- Fixed invalid SQL generatered by Subquery.as_sql().My-Name-Is-Nabil
2022-01-14Fixed #33441 -- Restored immutability of models.Field.__hash__().Adam Johnson
Regression in 502e75f9ed5476ffe8229109acf0c23999d4b533.
2022-01-13Improved Model.__init__() properties loop.Adam Johnson
This improves readability, accumulates unrecognized arguments raise an exception with all of them, and avoids refetching the values.
2022-01-11Fixed #13251 -- Made pre/post_delete signals dispatch the origin.mgaligniana
2022-01-07Fixed #33216 -- Simpilified deconstructed paths for some expressions.Allen Jonathan David
2022-01-05Fixed #32511 -- Corrected handling prefetched nested reverse relationships.Jamie Matthews
When prefetching a set of child objects related to a set of parent objects, we usually want to populate the relationship back from the child to the parent to avoid a query when accessing that relationship attribute. However, there's an edge case where the child queryset itself specifies a prefetch back to the parent. In that case, we want to use the prefetched relationship rather than populating the reverse relationship from the parent.
2022-01-04Fixed #33402 -- Optimized multiple AlterFooTogether operations.David Wobrock
2022-01-04Fixed #33406 -- Avoided creation of MaxLengthValidator(None) when resolving ↵Keryn Knight
Value.output_field for strings. This brings the behaviour in line with Field subclasses which append to the validators within __init__(), like BinaryField, and prevents the creation of a validator which incorrectly throws a TypeError, if it were used.
2022-01-04Fixed #33408 -- Fixed adding nullable unique fields on SQLite.Mariusz Felisiak
Regression in 2f73e5406d54cb8945e187eff302a3a3373350be. Thanks Alan Crosswell for the report.
2022-01-03Refs #29026 -- Allowed customizing InteractiveMigrationQuestioner's prompt ↵Jacob Walls
destination. Previously, the questioner did not obey the value of stdout provided to the command.
2021-12-30Fixed #23273 -- Avoided creation of django_migrations table when there are ↵Jacob Walls
no migrations to apply.
2021-12-27Refs #29517 -- Removed obsolete PositiveIntegerField test skip.Tim Graham
2021-12-23Refs #33355 -- Constructed SQLite list aggregate types once.Adam Johnson
2021-12-23Refs #33355 -- Removed @none_guard from SQLite functions.Adam Johnson
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-23Refs #33355 -- Made trunc functions raise ValueError on invalid lookups on ↵Adam Johnson
SQLite. Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-23Refs #33355 -- Moved SQLite functions to separate module.Adam Johnson
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>