(ctx: CLIContext, app_labels: tuple[str, ...])
| 601 | |
| 602 | |
| 603 | async def history(ctx: CLIContext, app_labels: tuple[str, ...]) -> None: |
| 604 | tortoise_config = _load_config(ctx) |
| 605 | apps_config = _select_apps(tortoise_config, app_labels or None) |
| 606 | apps_dict = {label: app.to_dict() for label, app in apps_config.items()} |
| 607 | apps_by_connection = _group_apps_by_connection(apps_dict) |
| 608 | |
| 609 | config_dict = tortoise_config.to_dict() |
| 610 | config_dict["apps"] = apps_dict |
| 611 | |
| 612 | async with tortoise_cli_context(config_dict): |
| 613 | for connection_name, subset in apps_by_connection.items(): |
| 614 | recorder = MigrationRecorder(get_connection(connection_name)) |
| 615 | applied = await recorder.applied_migrations() |
| 616 | _emit_history(applied, connection_name, subset) |
| 617 | |
| 618 | |
| 619 | async def heads(ctx: CLIContext, app_labels: tuple[str, ...]) -> None: |
no test coverage detected
searching dependent graphs…