'Is there a way to create a Django migrations not in the last position?

suppose that this is the migrations history to my project:

 [X] 0001_initial
      .
      .
      .
 [X] 0010_auto_20211202_0923
 [X] 0011_auto_20211202_1050
 [X] 0012_auto_20211202_1240
 [X] 0013_auto_20211202_1522
 [X] 0014_auto_20211202_1534
 [X] 0015_auto_20211202_1555
 [X] 0016_auto_20211202_1567
      .
      .
      .
 [X] 0021_data_migration

I would like to create a new migration in the middle of the history, between 000_13 and 000_14.



Solution 1:[1]

idk if that's possible.

You could just reverse your migrations and start again?

python manage.py migrate appname zero

python manage.py makemigrations

python manage.py migrate

Then you'd start from 0001 again.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thomas Lewin