summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Ljungberg <hannes.ljungberg@gmail.com>2021-01-13 19:38:23 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 08:32:26 +0100
commitffe756d6242d513bfbba9686b5a3d90f0a67c214 (patch)
tree3ce80a9836f6014191a7542bb0fb4784aa3e53ad
parentb5cef91a91c9dbb697b65ef978a7de0b2c5cf564 (diff)
Refs #26167 -- Changed default value of DatabaseFeatures.supports_expression_indexes to True.
-rw-r--r--django/db/backends/base/features.py2
-rw-r--r--django/db/backends/oracle/features.py1
-rw-r--r--django/db/backends/postgresql/features.py1
-rw-r--r--django/db/backends/sqlite3/features.py1
-rw-r--r--docs/releases/3.2.txt6
5 files changed, 7 insertions, 4 deletions
diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py
index 7e22f879ba..4c89231295 100644
--- a/django/db/backends/base/features.py
+++ b/django/db/backends/base/features.py
@@ -282,7 +282,7 @@ class BaseDatabaseFeatures:
# Does the backend support covering indexes (CREATE INDEX ... INCLUDE ...)?
supports_covering_indexes = False
# Does the backend support indexes on expressions?
- supports_expression_indexes = False
+ supports_expression_indexes = True
# Does the backend treat COLLATE as an indexed expression?
collate_as_index_expression = False
diff --git a/django/db/backends/oracle/features.py b/django/db/backends/oracle/features.py
index bedc398517..2570675809 100644
--- a/django/db/backends/oracle/features.py
+++ b/django/db/backends/oracle/features.py
@@ -59,7 +59,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_ignore_conflicts = False
max_query_params = 2**16 - 1
supports_partial_indexes = False
- supports_expression_indexes = True
supports_slicing_ordering_in_compound = True
allows_multiple_constraints_on_same_fields = False
supports_boolean_expr_in_select_clause = False
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py
index b7ec377739..84259c0c19 100644
--- a/django/db/backends/postgresql/features.py
+++ b/django/db/backends/postgresql/features.py
@@ -58,7 +58,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_deferrable_unique_constraints = True
has_json_operators = True
json_key_contains_list_matching_requires_list = True
- supports_expression_indexes = True
django_test_skips = {
'opclasses are PostgreSQL only.': {
diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py
index 31055f8f99..3348256c74 100644
--- a/django/db/backends/sqlite3/features.py
+++ b/django/db/backends/sqlite3/features.py
@@ -38,7 +38,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_pragma_foreign_key_check = Database.sqlite_version_info >= (3, 20, 0)
can_defer_constraint_checks = supports_pragma_foreign_key_check
supports_functions_in_partial_indexes = Database.sqlite_version_info >= (3, 15, 0)
- supports_expression_indexes = True
supports_over_clause = Database.sqlite_version_info >= (3, 25, 0)
supports_frame_range_fixed_distance = Database.sqlite_version_info >= (3, 28, 0)
supports_aggregate_filter_clause = Database.sqlite_version_info >= (3, 30, 1)
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt
index 2b0f0ee6ee..3b1463be6f 100644
--- a/docs/releases/3.2.txt
+++ b/docs/releases/3.2.txt
@@ -668,6 +668,12 @@ backends.
backends must implement ``DatabaseClient.settings_to_cmd_args_env()`` or
override ``DatabaseClient.runshell()``.
+* Third-party database backends must implement support for functional indexes
+ (:attr:`.Index.expressions`) or set
+ ``DatabaseFeatures.supports_expression_indexes`` to ``False``. If ``COLLATE``
+ is not a part of the ``CREATE INDEX`` statement, set
+ ``DatabaseFeatures.collate_as_index_expression`` to ``True``.
+
:mod:`django.contrib.admin`
---------------------------