Repository navigation
Changed
-
0001_initialis now idempotent and swappable-user-model safe.
The migration builds its tables through the schema editor
(create_model), guarded to run only whendynamic_columns_*are
absent, instead of a plainCreateModel. Two payoffs:- Pre-existing schema no longer collides. Projects that predate
the package extraction (notably BPP, whose in-treedynamic_columns
app created these tables years ago) can apply0001_initialonto a
database that already carries the tables — it detects them and
no-ops. This makes the dedicatedMIGRATION_MODULESoverride such
projects used to ship unnecessary; they can drop it and consume the
package's migrations directly. - Custom user models resolve correctly on a from-empty build. The
userFK is materialised by the schema editor against
settings.AUTH_USER_MODEL, so a freshmigrate(or
migrate --create-db/ baseline rebuild) on a project with a
swapped user model points the FK at the right table instead of a
hard-codedauth_user.
The migration state is unchanged (a
CreateModelpair plus the
existing constraints, now underSeparateDatabaseAndState), so
databases that already recorded0001_initialas applied are
unaffected andmakemigrationsdetects no drift. - Pre-existing schema no longer collides. Projects that predate