Prevoiusly my model consist of three records id (primary key), router_id, as_num and neighbor_id then I'm trying to alter 'id' field in database by changing a field name to from 'id' to 'auto_id'.
Here's my model
class dataFromFile(models.Model):
auto_id = models.AutoField(primary_key=True, default=0)
router_ip = models.CharField(max_length=20)
as_num = models.IntegerField(default=0)
neighbor_ip = models.CharField(max_length=20)
then using command python manage.py makemigrations peersite
gave me a message "No changes detected in app 'peersite'"
then using python manage.py sqlmigrate peersite 0001
seems fine with no error. But with python manage.py migrate peersite
gave
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1091, "Can't DROP 'id'; check that column/key exists")
I've checked in table dataFromFile in the database, also no 'id' field.
Any solution here ? Thank you in advance