#35763: Setting the auto increment value of a database model breaks when you
add a
new field to the model
-------------------------------------+-------------------------------------
Reporter: Kevin Renskers | Owner: Sachin
| Kundalwal
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Kevin Renskers):
> Are you saying that further migrations (third, fourth) are not causing
any issues for you?
No. Every migration that adds a new field to the model undoes the auto
increment value change, and thus I need to add `migrations.RunSQL("UPDATE
sqlite_sequence SET seq = 50000 WHERE name = 'content_content'")` to every
single migration that adds a new field to my model.
> What I mean is that your use case seems a very specific need arising
from a niche use case.
I respectfully disagree. I change the auto increment value of my table,
and Django's migration undoes this.
--
Ticket URL: <https://code.djangoproject.com/ticket/35763#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701920a4cc617-1424127c-2360-41ca-bd6f-fa65580b21ec-000000%40eu-central-1.amazonses.com.