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

Function _add_sqlmigrate_parser

tortoise/cli/cli.py:784–793  ·  view source on GitHub ↗
(subparsers: argparse._SubParsersAction)

Source from the content-addressed store, hash-verified

782
783
784def _add_sqlmigrate_parser(subparsers: argparse._SubParsersAction) -> None:
785 sqlmigrate_parser = subparsers.add_parser("sqlmigrate", help="Print the SQL for a migration.")
786 sqlmigrate_parser.add_argument("app_label", nargs="?", help="App label.")
787 sqlmigrate_parser.add_argument("migration_name", nargs="?", help="Migration name.")
788 sqlmigrate_parser.add_argument(
789 "--backward",
790 action="store_true",
791 help="Generate SQL to unapply the migration.",
792 )
793 sqlmigrate_parser.set_defaults(func=_run_sqlmigrate)
794
795
796def _build_parser() -> argparse.ArgumentParser:

Callers 1

_build_parserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…