Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on PostgreSQL. #12733

Merged
merged 2 commits into from Apr 17, 2020
Merged

Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on PostgreSQL. #12733

merged 2 commits into from Apr 17, 2020

Conversation

jdufresne
Copy link
Member

@jdufresne jdufresne commented Apr 16, 2020

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.

https://code.djangoproject.com/ticket/31473

@charettes
Copy link
Member

The reset_sequences bool flag makes sense, I always wondered why we were passing sequences in the first place.

@felixxm
Copy link
Member

felixxm commented Apr 17, 2020

I rebased after #12729.

@django django deleted a comment from jdufresne Apr 17, 2020
Added early return to decrease an indentation level.
…ces 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.
@felixxm felixxm changed the title Fixed #31473 -- Made PostgreSQL sql_flush() op use TRUNCATE … RESTART IDENTITY to reset sequences. Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on PostgreSQL. Apr 17, 2020
@felixxm
Copy link
Member

felixxm commented Apr 17, 2020

@jdufresne Thanks 🚀

@jdufresne
Copy link
Member Author

All edits LGTM. Thanks @felixxm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants