#31473: Use PostgreSQL TRUNCATE … RESTART IDENTITY keyword to reset sequences in
sql_flush()
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"75410228dfd16e49eb3c0ea30b59b4c0d2ea6b03" 7541022]:
{{{
#!CommitTicketReference repository=""
revision="75410228dfd16e49eb3c0ea30b59b4c0d2ea6b03"
Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences
on PostgreSQL.
The sql_flush() positional argument sequences is replaced by the boolean
keyword-only argument reset_sequences. This ensures that the old
function signature can't be used by mistake when upgrading Django. When
the new argument is True, the sequences of the truncated tables will
reset. Using a single boolean value, rather than a list, allows making a
binary yes/no choice as to whether to reset all sequences rather than a
working on a completely different set.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31473#comment:4>
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/067.bd34d5e737deef9e9f8d6c2e363c85f3%40djangoproject.com.