Django’s makemigrations --empty option creates a migration file with no operations. Think of it as an intentionally blank checkpoint: the migration system handles its place in the dependency chain, while you add custom work such as data transformation. section 10.6
Use the flag when you need to:
- Create a stub for a RunPython operation that changes existing rows. section 10.6
- Place data-copying logic after a schema migration has added the destination fields. section 10.2
- Write forward and backward functions when the data transformation can be reversed. section 10.2
Create a custom migration stub
Run the command from the project directory: python manage.py makemigrations --empty promoters Django generates a migration such as promoters/migrations/0004_auto_20230904_1552.py. You can rename it to a clearer filename, such as 0004_data_fullname.py, then add the dependency and custom operation. The generated starting point contains an empty operations list, so nothing changes in the database until you edit the file. section 10.2
