Update to Django 3.2 #421

Closed
opened 2021-04-08 11:37:04 +02:00 by nik · 12 comments
Owner

Django 3.2 has been released, and we should update to it. Doing so, the following changes in Django seem relevant:

  • Automatic AppConfig discovery — we can drop the default_app_config from all __init__.pys
  • DEFAULT_AUTO_FIELD is recommended to be BigAutoField, even though it is not the default yet. We should consider setting it explicitly (but need to check whether this will cause migrations in libraries if set…)
  • Functional indexes are now supported — we need to check models thatare often queried using a database function (e.g. aggregates), and add functional indexes for those queries (but leave the index out if write performance is more critical than search performance!)
  • makemigrations can now be called without a database connection — that means we can add a check for missing migrations to the pipelines
  • Index.include and UniqueConstraint.include are now supported for creating covering indexes — we should check whether we have queries that can be turned into index-only scans that way
  • FilteredRelation now supports nested relations (probably most important for Alsijil)
  • QuerySet.alias can be used instead of QuerySet.annotate for aliases that are only needed for filtering (probably most interesting for Alsijil)
  • Transforms in expressions — not sure
  • SECRET_KEY is not needed anymore for running most management commands — we can therefore remove the secret key from at least the migration job container in K8s
Django 3.2 has been released, and we should update to it. Doing so, the following changes in Django seem relevant: - [x] Automatic AppConfig discovery — we can drop the `default_app_config` from all `__init__.py`s - [x] `DEFAULT_AUTO_FIELD` is recommended to be `BigAutoField`, even though it is not the default yet. We should consider setting it explicitly (but need to check whether this will cause migrations in libraries if set…) - [ ] Functional indexes are now supported — we need to check models thatare often queried using a database function (e.g. aggregates), and add functional indexes for those queries (but leave the index out if write performance is more critical than search performance!) - [ ] `makemigrations` can now be called without a database connection — that means we can add a check for missing migrations to the pipelines - [ ] `Index.include` and `UniqueConstraint.include` are now supported for [creating covering indexes](https://www.postgresql.org/docs/13/indexes-index-only-scans.html) — we should check whether we have queries that can be turned into index-only scans that way - [x] `FilteredRelation` now supports nested relations (probably most important for Alsijil) - [x] `QuerySet.alias` can be used instead of `QuerySet.annotate` for aliases that are only needed for filtering (probably most interesting for Alsijil) - [x] [Transforms in expressions](https://docs.djangoproject.com/en/3.2/topics/db/queries/#using-transforms-in-expressions) — not sure - [ ] `SECRET_KEY` is not needed anymore for running most management commands — we can therefore remove the secret key from at least the migration job container in K8s
Author
Owner

created merge request !2209 to address this issue

created merge request !2209 to address this issue
Author
Owner

mentioned in merge request !2209

mentioned in merge request !2209
Owner

mentioned in commit 9ade204886

mentioned in commit 9ade2048861143c9f772cbfd214e6aaa108393be
nik reopened this issue 2021-04-08 17:04:23 +02:00
Author
Owner

created merge request !2211 to address this issue

created merge request !2211 to address this issue
Author
Owner

mentioned in merge request !2211

mentioned in merge request !2211
Author
Owner

marked the checklist item DEFAULT_AUTO_FIELD is recommended to be BigAutoField, even though it is not the default yet. We should consider setting it explicitly (but need to check whether this will cause migrations in libraries if set…) as completed

marked the checklist item **`DEFAULT_AUTO_FIELD` is recommended to be `BigAutoField`, even though it is not the default yet. We should consider setting it explicitly (but need to check whether this will cause migrations in libraries if set…)** as completed
Author
Owner

marked the checklist item Automatic AppConfig discovery — we can drop the default_app_config from all __init__.pys as completed

marked the checklist item **Automatic AppConfig discovery — we can drop the `default_app_config` from all `__init__.py`s** as completed
Author
Owner

marked the checklist item FilteredRelation now supports nested relations (probably most important for Alsijil) as completed

marked the checklist item **`FilteredRelation` now supports nested relations (probably most important for Alsijil)** as completed
Author
Owner

marked the checklist item QuerySet.alias can be used instead of QuerySet.annotate for aliases that are only needed for filtering (probably most interesting for Alsijil) as completed

marked the checklist item **`QuerySet.alias` can be used instead of `QuerySet.annotate` for aliases that are only needed for filtering (probably most interesting for Alsijil)** as completed
Author
Owner

marked the checklist item Transforms in expressions — not sure as completed

marked the checklist item **[Transforms in expressions](https://docs.djangoproject.com/en/3.2/topics/db/queries/#using-transforms-in-expressions) — not sure** as completed
Author
Owner

marked the checklist item QuerySet.alias can be used instead of QuerySet.annotate for aliases that are only needed for filtering (probably most interesting for Alsijil) as incomplete

marked the checklist item **`QuerySet.alias` can be used instead of `QuerySet.annotate` for aliases that are only needed for filtering (probably most interesting for Alsijil)** as incomplete
Author
Owner

marked the checklist item QuerySet.alias can be used instead of QuerySet.annotate for aliases that are only needed for filtering (probably most interesting for Alsijil) as completed

marked the checklist item **`QuerySet.alias` can be used instead of `QuerySet.annotate` for aliases that are only needed for filtering (probably most interesting for Alsijil)** as completed
nik closed this issue 2021-05-15 15:36:31 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS-Core#421
No description provided.