A reversible migration defines both forward and backward operations, so a database change can be applied and undone. Django’s RunPython operation supplies one function for each direction. section 10.2
A practical data migration follows this sequence:
- Add the replacement fields and create the schema migration. section 10.2
Renaming Promoter name data
The forward function copies first_name and last_name into full_name and common_name. The backward function reconstructs first_name and last_name from those replacement fields. section 10.2
