columns
columns
Additional column-specific invariants.
NoUnexpectedColumns
Bases: ComparisonBInvariant
Verify no unexpected columns exist in actual schema.
This checks for columns that exist in the database but are not defined in the expected schema (from migrations). This can happen when columns are manually added to the database.
name
property
description
property
check(expected_schema, actual_schema)
ColumnNullabilityMatches
Bases: ComparisonBInvariant
Verify column nullability matches between expected and actual schema.
This checks that columns have the correct NULL/NOT NULL constraint. Mismatches can occur when migrations are modified or database is manually altered.
name
property
description
property
check(expected_schema, actual_schema)
NoMissingPrimaryKeys
Bases: ComparisonBInvariant
Verify all tables have a primary key column.
This is a best practice check to ensure all tables have a primary key. Most Django models have an 'id' field as primary key.