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

Function _write_migrations

tests/cli/test_cli.py:45–59  ·  view source on GitHub ↗
(pkg: Path, migration_names: list[str])

Source from the content-addressed store, hash-verified

43
44
45def _write_migrations(pkg: Path, migration_names: list[str]) -> None:
46 migrations = pkg / "migrations"
47 migrations.mkdir()
48 (migrations / "__init__.py").write_text("", encoding="utf-8")
49 for name in migration_names:
50 (migrations / f"{name}.py").write_text(
51 """
52from tortoise.migrations.migration import Migration
53
54
55class Migration(Migration):
56 pass
57""".lstrip(),
58 encoding="utf-8",
59 )
60
61
62def _write_settings(tmp_path: Path, content: str, module_name: str) -> str:

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…