summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/contrib/postgres/indexes.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/django/contrib/postgres/indexes.py b/django/contrib/postgres/indexes.py
index 363a9431ae..cc944ed335 100644
--- a/django/contrib/postgres/indexes.py
+++ b/django/contrib/postgres/indexes.py
@@ -117,20 +117,27 @@ class BrinIndex(PostgresIndex):
class BTreeIndex(PostgresIndex):
suffix = "btree"
- def __init__(self, *expressions, fillfactor=None, **kwargs):
+ def __init__(self, *expressions, fillfactor=None, deduplicate_items=None, **kwargs):
self.fillfactor = fillfactor
+ self.deduplicate_items = deduplicate_items
super().__init__(*expressions, **kwargs)
def deconstruct(self):
path, args, kwargs = super().deconstruct()
if self.fillfactor is not None:
kwargs["fillfactor"] = self.fillfactor
+ if self.deduplicate_items is not None:
+ kwargs["deduplicate_items"] = self.deduplicate_items
return path, args, kwargs
def get_with_params(self):
with_params = []
if self.fillfactor is not None:
with_params.append("fillfactor = %d" % self.fillfactor)
+ if self.deduplicate_items is not None:
+ with_params.append(
+ "deduplicate_items = %s" % ("on" if self.deduplicate_items else "off")
+ )
return with_params