Django
Revert/combine uncommitted migration
You are developing a new feature. You already created a migration file that you applied, but did not commit yet. You make changes to the model, and you would like to combine this change with the previous migraiton.
This is how to proceed:
List the migration to find the last one before your change:
python manage.py showmigrations
Revert to the state before your last uncommitted migration:
python manage.py migrate myproject 0054_auto_20240703_1421
Delete the file from the previous migration
Create a new migration that combines the previous and new changes:
python manage.py makemigrations
Apply the migrations:
python manage.py migrate