summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2020-04-09Refs #22608 -- Made app_label required when optimizing migrations.Simon Charette
This paved the way for the removal of lot of logic when app_label was not specified.
2020-04-08Fixed #28184 -- Allowed using a callable for FileField and ImageField storage.miigotu
2020-04-07Refs #29000 -- Restored delayed model rendering of RenameField.Simon Charette
Non-delayed rendering is unnecessary and wasteful now that state models relationship consistency on delayed reload is ensured. This partly reverts commit fcc4e251dbc917118f73d7187ee2f4cbf3883f36.
2020-04-07Refs #27666 -- Ensured relationship consistency on delayed reloads.Simon Charette
Delayed reloads of state models broke identity based relationships between direct and non-direct ancestors. Basing models.Options related objects map of model labels instead of their identity ensured relationship consistency is maintained. Refs #30966. Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2020-04-06Fixed #31030 -- Registered SQLite functions as deterministic on Python 3.8+.Sergey Fedoseev
2020-04-06Fixed #31426 -- Added proper field validation to QuerySet.order_by().Simon Charette
Resolve the field reference instead of using fragile regex based string reference validation.
2020-04-06Refs #7098 -- Deprecated passing raw column aliases to order_by().Simon Charette
Now that order_by() has expression support passing RawSQL() can achieve the same result. This was also already supported through QuerySet.extra(order_by) for years but this API is more or less deprecated at this point.
2020-04-06Fixed #31420 -- Fixed crash when filtering subquery annotation against a ↵Hasan Ramezani
SimpleLazyObject. Thanks Simon Charette for the solution and analysis.
2020-04-04Fixed #31415 -- Fixed crash when nested OuterRef is used with operators or ↵Hasan Ramezani
in database functions.
2020-04-02Fixed #31275 -- Optimized sql_flush() without resetting sequences on MySQL.c-bata
Co-Authored-By: Simon Charette <charettes@users.noreply.github.com>
2020-04-02Refs #31051 -- Optimized serialize_db_to_string() by avoiding creation of ↵Matthijs Kooijman
models list.
2020-04-02Refs #31051 -- Fixed reloading the database with circular related objects ↵Matthijs Kooijman
and natural keys for tests. Made deserialize_db_from_string() do not sort dependencies. deserialize_db_from_string() doesn't use natural keys, so there is no need to sort dependencies in serialize_db_to_string(). Moreover, sorting models cause issues for circular dependencies.
2020-04-02Fixed #31411 -- Used RENAME COLUMN on MariaDB 10.5.2+.Hasan Ramezani
2020-04-01Refs #12990 -- Moved PostgresSimpleLookup to the ↵Mariusz Felisiak
django.db.models.lookups.PostgresOperatorLookup.
2020-03-31Fixed #31403 -- Added support for returning fields from INSERT statements on ↵Adam Johnson
MariaDB 10.5+.
2020-03-31Refs #31403 -- Made SQLInsertCompiler.execute_sql() always return an ↵Adam Johnson
iterable of rows. List of tuples.
2020-03-25Fixed #31399 -- Made SchemaEditor._alter_field() ignore foreign key ↵Tim Graham
constraints if unsupported.
2020-03-25Fixed #23916 -- Allowed makemigrations to handle related model name case ↵Adam Johnson
changes. Made autodetector ignore related model name case changes so unnecessary migrations are not created.
2020-03-25Fixed #31396 -- Added binary XOR operator to F expressions.Hannes Ljungberg
2020-03-25Fixed #31377 -- Disabled grouping by aliases on ↵Hasan Ramezani
QuerySet.values()/values_list() when they collide with field names. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Thanks Holovashchenko Vadym for the report.
2020-03-24Fixed #31392 -- Avoided unnecessary SchemaEditor.effective_default() calls ↵Shipeng Feng
when altering a field.
2020-03-20Refs #29724 -- Added is_dst parameter to QuerySet.datetimes().Hasan Ramezani
Thanks Simon Charette for the review and Mariusz Felisiak for tests.
2020-03-20Fixed #31144 -- Relaxed system check for max_length of CharFields on ↵Rohit
MySQL/MariaDB by turning into a warning.
2020-03-19Fixed #31285 -- Fixed inherited Meta.ordering of "-pk".Jon Dufresne
2020-03-19Refs #29548 -- Mentioned MariaDB in database system checks.Mariusz Felisiak
2020-03-18Refs #31055 -- Made long column names checks support databases aware.Mariusz Felisiak
2020-03-18Fixed #31376 -- Optimized nulls ordering when possible on SQLite and MySQL.Simon Charette
Both backends order NULLs first on ascending ordering and last on descending ordering which makes ORDER BY IS (NOT)? NULL wasteful when asc(nulls_first) and desc(nulls_last) are used since it prevents indice usage.
2020-03-11Fixed #31359 -- Deprecated get_random_string() calls without an explicit length.Claude Paroz
2020-03-09Fixed #31318 -- Allowed sqlmigrate to inspect squashed migrations.David Wobrock
2020-03-09Refs #31318 -- Moved MigrationExecutor.collect_sql() to MigrationLoader.David Wobrock
collect_sql() is used only in sqlmigrate.
2020-03-06Fixed #31345 -- Added BaseDatabaseIntrospection.get_relations().shankarj67
2020-03-05Fixed #29129 -- Skipped UPDATE when adding a model instance with inherited ↵Abhijeet Viswa
primary key that has a default.
2020-03-05Fixed #31327 -- Deprecated providing_args argument for Signal.Jon Dufresne
2020-03-04Fixed #31333 -- Added BaseDatabaseIntrospection.get_table_description().aryan
2020-03-03Refs #31331 -- Added DatabaseWrapper.sql_mode to MySQL.Mariusz Felisiak
2020-03-03Fixed #31150 -- Included subqueries that reference related fields in GROUP ↵Mariusz Felisiak
BY clauses. Thanks Johannes Hoppe for the report. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Co-authored-by: Simon Charette <charette.s@gmail.com>
2020-03-02Refs #26064 -- Avoided unnecessary list slicing in migration optimizer.Simon Charette
The in_between list is only necessary if an optimization is possible.
2020-02-28Fixed #31301 -- Fixed crash of QuerySet.bulk_create() with mixed empty and ↵Hans Aarne Liblik
set ForeignKeys to AutoFields on Oracle.
2020-02-28Fixed #31310 -- Fixed hints in checks for using intermediate model with ↵Matheus Cunha Motta
ambiguous foreign key. symmetrical=False is not required since 87b1ad6e7351464c60e751b483d9dfce3a2d3382.
2020-02-27Fixed #31251 -- Disabled grouping by OuterRef() annotation.Rohit
2020-02-27Fixed #31185 -- Fixed detecting of unique fields in ForeignKey/ForeignObject ↵Valze
checks when using Meta.constraints.
2020-02-27Fixed #31312 -- Properly ordered temporal subtraction params on MySQL.Simon Charette
Regression in 9bcbcd599abac91ea853b2fe10b784ba32df043e. Thanks rick2ricks for the report.
2020-02-24Fixed #31286 -- Made database specific fields checks databases aware.Taoup
Follow up to 0b83c8cc4db95812f1e15ca19d78614e94cf38dd.
2020-02-19Refs #31187 -- Added total_unique_constraints property to model's Options.Mariusz Felisiak
2020-02-18Refs #31282 -- Clarified M2O add/remove/set with PK behaviour.Carlton Gibson
Improved error message for remove() and added tests.
2020-02-18Fixed #31271 -- Preserved ordering when unifying query parameters on Oracle.Mariusz Felisiak
This caused misplacing parameters in logged SQL queries. Regression in 79065b55a70cd220820a260a1c54851b7be0615a. Thanks Hans Aarne Liblik for the report.
2020-02-18Fixed #31228 -- Reallowed aggregates to be used with multiple expressions ↵Taoup
and no DISTINCT on SQLite. Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111. Thanks Andy Terra for the report.
2020-02-17Fixed #31277 -- Relaxed system check of m2m intermediary tables for db_table ↵Xavier Francisco
collision when database routers are installed. Turned the error into a warning when database routers are installed.
2020-02-14Fixed #26552 -- Deferred constraint checks when reloading the database with ↵Matthijs Kooijman
data for tests. deserialize_db_from_string() loads the full serialized database contents, which might contain forward references and cycles. That caused IntegrityError because constraints were checked immediately. Now, it loads data in a transaction with constraint checks deferred until the end of the transaction.
2020-02-11Fixed #31246 -- Fixed locking models in QuerySet.select_for_update(of=()) ↵Abhijeet Viswa
for related fields and parent link fields with multi-table inheritance. Partly regression in 0107e3d1058f653f66032f7fd3a0bd61e96bf782.