MCPcopy
hub / github.com/django/django / rename_index

Method rename_index

django/db/backends/base/schema.py:589–597  ·  view source on GitHub ↗
(self, model, old_index, new_index)

Source from the content-addressed store, hash-verified

587 self.execute(index.remove_sql(model, self))
588
589 def rename_index(self, model, old_index, new_index):
590 if self.connection.features.can_rename_index:
591 self.execute(
592 self._rename_index_sql(model, old_index.name, new_index.name),
593 params=None,
594 )
595 else:
596 self.remove_index(model, old_index)
597 self.add_index(model, new_index)
598
599 def add_constraint(self, model, constraint):
600 """Add a constraint to a model."""

Callers

nothing calls this directly

Calls 4

executeMethod · 0.95
_rename_index_sqlMethod · 0.95
remove_indexMethod · 0.95
add_indexMethod · 0.95

Tested by

no test coverage detected