MCPcopy
hub / github.com/django/django / database_backwards

Method database_backwards

django/db/migrations/operations/special.py:114–120  ·  view source on GitHub ↗
(self, app_label, schema_editor, from_state, to_state)

Source from the content-addressed store, hash-verified

112 self._run_sql(schema_editor, self.sql)
113
114 def database_backwards(self, app_label, schema_editor, from_state, to_state):
115 if self.reverse_sql is None:
116 raise NotImplementedError("You cannot reverse this operation")
117 if router.allow_migrate(
118 schema_editor.connection.alias, app_label, **self.hints
119 ):
120 self._run_sql(schema_editor, self.reverse_sql)
121
122 def describe(self):
123 return "Raw SQL operation"

Callers 6

test_run_sqlMethod · 0.95
test_run_sql_paramsMethod · 0.95
test_run_sql_noopMethod · 0.95
database_backwardsMethod · 0.45

Calls 2

_run_sqlMethod · 0.95
allow_migrateMethod · 0.45

Tested by 5

test_run_sqlMethod · 0.76
test_run_sql_paramsMethod · 0.76
test_run_sql_noopMethod · 0.76