Archives week 23 of 2021
June 7, 2021 - June 13, 2021
Django Field Rename Migrations and Test Cases
Written by
on
in
Snaking.
Is there some trick to running Django test cases when you've got a RenameField later in the migration-stack? I feel like this has to be some obvious thing I'm missing...
With a migration (say 0058_big_restructure.py) which does this:
migrations.RenameField(
model_name='rfsource',
old_name='source_name',
new_name='follow_source_name',
),
and a previous migration, (say 0006_long_ago_change_that_populates_some_other_field.py) which doesn't explicitly reference the source_name ...