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

Function _emit_history

tortoise/cli/cli.py:296–313  ·  view source on GitHub ↗
(
    applied: list[MigrationKey],
    connection_name: str,
    apps_config: dict[str, dict[str, Any]],
)

Source from the content-addressed store, hash-verified

294
295
296def _emit_history(
297 applied: list[MigrationKey],
298 connection_name: str,
299 apps_config: dict[str, dict[str, Any]],
300) -> None:
301 by_app: dict[str, list[str]] = {label: [] for label in apps_config}
302 for key in applied:
303 if key.app_label in by_app:
304 by_app[key.app_label].append(key.name)
305 _echo_connection_header(connection_name)
306 for app_label in sorted(by_app):
307 _echo_app_header(app_label)
308 names = by_app[app_label]
309 if not names:
310 print(f" {_DIM}(no applied migrations){_RESET}")
311 continue
312 for name in names:
313 print(f" {_GREEN}-{_RESET} {app_label} {name}")
314
315
316def _emit_heads(

Callers 1

historyFunction · 0.85

Calls 2

_echo_connection_headerFunction · 0.85
_echo_app_headerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…