Expand description
Canonical migration authoring core (#166).
Owns the single SchemaDiff -> ordered operations mapping shared by the
live makemigrations flow and the offline authoring API. Everything here
is pure: no database connection, no filesystem access, no clock reads.
Structs§
- Author
Migration Request - A complete offline authoring request.
- Authored
Artifact - One in-memory artifact file, path relative to the migrations directory.
- Authored
Migration - The complete authored artifact set for one migration.
- Migration
Metadata - Identity and dependency metadata for one authored migration.
- Positioned
Operations - Explicit portable operations placed around the schema change set.
- Python
Render Request - Everything needed to render one migration
.py. - Rendered
Snapshot - One rendered snapshot: file contents keyed by path relative to the
migrations directory (e.g.
snapshots/v0003/entities.py). - Snapshot
Context - Snapshot/version context for one authored migration.
- Snapshot
Render Request - Inputs for rendering one snapshot version.
Enums§
- Existing
Artifact Policy - How to treat artifact paths that already exist on disk.
Functions§
- author_
migration - Author the complete artifact set for one migration, in memory.
- map_
schema_ diff - Map a computed [
SchemaDiff] into the ordered authoring operation list. - migration_
class_ name - Convert a migration name suffix into its class name
(
add_company->AddCompanyMigration). - py_repr
- Render a Python string literal exactly like CPython’s
repr(). - render_
migration_ python - Render the complete migration
.pysource. - render_
snapshot - Render the complete snapshot file set in memory.
- write_
authored_ migration - Write every artifact of
authoredundermigrations_dir.