MCPcopy
hub / github.com/django/django / reduce

Method reduce

django/db/migrations/operations/models.py:941–948  ·  view source on GitHub ↗
(self, operation, app_label)

Source from the content-addressed store, hash-verified

939 return "%s_%s" % (self.model_name_lower, self.index.name.lower())
940
941 def reduce(self, operation, app_label):
942 if isinstance(operation, RemoveIndex) and self.index.name == operation.name:
943 return []
944 if isinstance(operation, RenameIndex) and self.index.name == operation.old_name:
945 index = copy(self.index)
946 index.name = operation.new_name
947 return [replace(self, index=index)]
948 return super().reduce(operation, app_label)
949
950
951class RemoveIndex(IndexOperation):

Callers 7

reduceMethod · 0.45
reduceMethod · 0.45
reduceMethod · 0.45
reduceMethod · 0.45
reduceMethod · 0.45
reduceMethod · 0.45
reduceMethod · 0.45

Calls 1

replaceFunction · 0.90

Tested by

no test coverage detected