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
OS: Centos7
Python: 3.7.10
Django: 2.2.28
Db: Mysql 5.6.34