Migrations file is repeated

Hello, I just alter the field in models and then do ‘make makemigrations ’, but I get some same migrations code file(except the dependencies).

First create field in 0034_xxx.py.

‘’’
class Migration(migrations.Migration):

dependencies = [
    ('cmdb', '0033_auto_20230312_1612'),
]

options = [
    migrations.AddField(
        model_name='networkequipment',
        name='ssh_show_routingtable_command',
        field=models.CharField(blank=True, choices=[('show ip route', 'show ip route'), ('dis ip routing-table', 'dis ip routing-table')], default='dis ip routing-table', max_length=255, null=True)
        ),
]

‘’’

Migrations file 0039_auto_20230417_0839.py ( maybe some bad?)

class Migration(migrations.Migration):

dependencies = [
    ('cmdb', '0038_auto_20230316_1612'),
]

operations = [
    migrations.AlterField(
        model_name='networkequipment',
        name='ssh_show_routingtable_command',
        field=models.CharField(blank=True, choices=[('show ip route', 'show ip route'), ('dis ip routing-table', 'dis ip routing-table')], default='dis ip routing-table', max_length=255, null=True),
    ),
]

Migrations file 0040_auto_20230417_0950.py (maybe some bad?)

class Migration(migrations.Migration):

dependencies = [
    ('cmdb', '0039_auto_20230417_0839'),
]

operations = [
    migrations.AlterField(
        model_name='networkequipment',
        name='ssh_show_routingtable_command',
        field=models.CharField(blank=True, choices=[('show ip route', 'show ip route'), ('dis ip routing-table', 'dis ip routing-table')], default='dis ip routing-table', max_length=255, null=True),
    ),
]

And if I do ‘make makemigrations ’ again, I also get next same migrations code file again.But I do no change to the model.
I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this, thanks :smiley:

OS: Centos7
Python: 3.7.10
Django: 2.2.28
Db: Mysql 5.6.34

What change are you making to the model?

What version of Python are you using?

Note: In the future, please don’t post images of code. Copy/paste the code into the body of your post, surrounded by lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```.

Thank you for your answer sincerely. I use Python 3.7.10, and I re-edit my question. I do no change to the model, but it just detect changed.

What happens if you run migrate. Do the migrations apply? Does a makemigrations then continue to make this same migration?

Yep, run migrate seems to do nothing because of same migration file, although migrations also apply well. And if I do makemigrations again then I get the same migraton files, it makes me confused.