MCPcopy
hub / github.com/tortoise/tortoise-orm / database_backward

Method database_backward

tortoise/migrations/operations.py:1243–1254  ·  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

1241 await self._run_sql(state_editor, self.sql)
1242
1243 async def database_backward(
1244 self,
1245 app_label: str,
1246 old_state: State,
1247 new_state: State,
1248 state_editor: BaseSchemaEditor | None = None,
1249 ) -> None:
1250 if not state_editor:
1251 return
1252 if self.reverse_sql is None:
1253 raise NotImplementedError("RunSQL reverse_sql is not set")
1254 await self._run_sql(state_editor, self.reverse_sql)
1255
1256 async def _run_sql(self, state_editor: BaseSchemaEditor, sqls) -> None:
1257 """Execute SQL statements using the schema editor."""

Callers 2

Calls 1

_run_sqlMethod · 0.95

Tested by 1