Skip to content

loader

loader

Migration History and Code Loader

This module handles Inputs 1 & 2 of the django-migration-audit architecture: 1. Migration history from the django_migrations table 2. Migration code from disk (migrations/*.py files)

It enables Comparison A: Trust Verification (history ↔ code) by detecting: - Modified migration files - Missing migration files - Fake-applied migrations - Squash mismatches

The core question this module helps answer: "Can we trust the migration history at all?"

MigrationNode(app, name) dataclass

app instance-attribute

name instance-attribute

MigrationHistory(applied, graph_nodes, missing_files, squashed_replacements, plan) dataclass

applied instance-attribute

graph_nodes instance-attribute

missing_files instance-attribute

squashed_replacements instance-attribute

plan instance-attribute

load_migration_history(using='default')

Load Django's migration history as factual data: - what is applied - what exists on disk - what is missing - what has been squashed - the resolved forward migration plan