Today my django app jumped from id 126 to 1125 in one of my models, 999 ids! Does anybody knows what could cause it?
See below the screenshot of my admin area, from my MSSQL database and also my model code: I appreciate any feedback that might help me to understand why django did it...
DJANGO ADMIN:
MSSQL:
MY MODEL: (which is working for many months without issues... Also, as you can see, the id is an AutoField, it is not in my class, only on the migrations file.)
class New_ticket(models.Model):
process_expert = models.ForeignKey(Team_Structure, on_delete=models.SET_NULL, limit_choices_to={'available':True}, blank=True, null=True)
status = models.ForeignKey(Status_table, on_delete=models.CASCADE, limit_choices_to={'available':True}, blank=True, null=True)
created_by = models.CharField(max_length=20)
created_on = models.DateTimeField()
option = models.ForeignKey(Options_table, on_delete=models.CASCADE, limit_choices_to={'available':True}, verbose_name="Where is the issue?")
priority_level = models.ForeignKey(Priority_level, on_delete=models.CASCADE, limit_choices_to={'available':True})
department = models.ForeignKey(Department, on_delete=models.CASCADE, limit_choices_to={'available':True})
transaction = models.CharField(max_length=50, blank=True)
zone = ChainedForeignKey(Zone,chained_field="option",chained_model_field="option", show_all=False, auto_choose=True, sort=True, blank=True, null=True)
duration_of_error = models.CharField(max_length=50, blank=True)
error_message = models.TextField(max_length=250)
comments = models.TextField(blank=True)
upload_1 = models.FileField(upload_to='uploads/', blank=True, validators=[file_size])
upload_2 = models.FileField(upload_to='uploads/', blank=True, validators=[file_size])
upload_3 = models.FileField(upload_to='uploads/', blank=True, validators=[file_size])
history = HistoricalRecords()
def __str__(self):
return str(self.id)
class Meta:
verbose_name_plural = "Tickets"