MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / database_backward

Method database_backward

tortoise/migrations/operations.py:1117–1130  ·  view source on GitHub ↗
(
        self,
        app_label: str,
        old_state: State,
        new_state: State,
        state_editor: BaseSchemaEditor | None = None,
    )

Source from the content-addressed store, hash-verified

1115 await result
1116
1117 async def database_backward(
1118 self,
1119 app_label: str,
1120 old_state: State,
1121 new_state: State,
1122 state_editor: BaseSchemaEditor | None = None,
1123 ) -> None:
1124 if not state_editor:
1125 return
1126 if self.reverse_code is None:
1127 raise NotImplementedError("RunPython reverse_code is not set")
1128 result = self.reverse_code(old_state.apps, state_editor)
1129 if inspect.isawaitable(result):
1130 await result
1131
1132 @staticmethod
1133 def noop(apps: StateApps, schema_editor: BaseSchemaEditor) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected