I have some models in my Django app and I saw the field 'auto_increment_id' (as PK) doesn't work as 'AUTO INCREMENT' (the DB is Postgres).
I made 2 records with auto_increment_id 1 and 2, delete record 2 and make a new one with auto_increment_id=3 instead of auto_increment_id=2.
models.py
class Testme(models.Model):
auto_increment_id = models.AutoField(primary_key=True)
year = models.ForeignKey(
Year,
verbose_name="Year",
blank=False,
on_delete=models.CASCADE,
)
def __str__(self):
return str(self.auto_increment_id)
How can I fix it?
Thanks a lot!