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

Add ability to reset auto-increment sequence #59

Closed
Jaymon opened this issue Dec 26, 2017 · 1 comment
Closed

Add ability to reset auto-increment sequence #59

Jaymon opened this issue Dec 26, 2017 · 1 comment

Comments

@Jaymon
Copy link
Owner

Jaymon commented Dec 26, 2017

I recently had a need in a test to mess with the auto-increments and this is what I did:

        Foo.interface.query(
            "ALTER SEQUENCE {}__id_seq RESTART WITH 218832".format(Foo.table_name),
            ignore_result=True
        )
        Bar.interface.query(
            "ALTER SEQUENCE {}__id_seq RESTART WITH 24".format(Bar.table_name),
            ignore_result=True
        )

It would be great if this was codified into the Interface, it could also discover the field's primary key name.

helpful link

@Jaymon
Copy link
Owner Author

Jaymon commented Mar 26, 2023

I've never needed to do this since and I don't think it needs to be codified into the interface and I don't think this issue needs to stay open

@Jaymon Jaymon closed this as completed Mar 26, 2023
@Jaymon Jaymon added the wontfix label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant