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

truncate() should allow resetting sequences. #5356

Closed
sushantdhiman opened this Issue Feb 3, 2016 · 4 comments

Comments

4 participants
@sushantdhiman
Member

sushantdhiman commented Feb 3, 2016

Model.truncate() method should optionally allow to reset the sequence of the primary key; It can be achieved by adding these queries

  • Postgres truncate table table_name restart identity;
@xorbis

This comment has been minimized.

xorbis commented Jun 23, 2016

Can truncate reset sequences now?
The reference by kylehotchkiss does not seem related.

@janmeier

This comment has been minimized.

Member

janmeier commented Jun 23, 2016

The issue is still open, so that would be a no :)

@janmeier

This comment has been minimized.

Member

janmeier commented Jun 23, 2016

The reference is not present in the linked issue, so must have been a typo

@xorbis

This comment has been minimized.

xorbis commented Jun 23, 2016

I look forward to this feature, thanks for the quick reply, you guys are awesome.

@janmeier janmeier closed this in e6d6f39 Aug 11, 2016

felixfbecker added a commit to felixfbecker/sequelize that referenced this issue Aug 11, 2016

Backport: Add option to restart identity when truncate
Issue sequelize#5356

  - update query interface with option restartIdentity
  - add test for option restartIdentity
  - update documentation for option restartIdentity with truncate
  - add restartIdentity entry in changelog

felixfbecker added a commit to felixfbecker/sequelize that referenced this issue Aug 11, 2016

Backport: Add option to restart identity when truncate
Issue sequelize#5356

  - update query interface with option restartIdentity
  - add test for option restartIdentity
  - update documentation for option restartIdentity with truncate
  - add restartIdentity entry in changelog

sushantdhiman added a commit that referenced this issue Aug 11, 2016

Backport: Add option to restart identity when truncate (#6417)
Issue #5356

  - update query interface with option restartIdentity
  - add test for option restartIdentity
  - update documentation for option restartIdentity with truncate
  - add restartIdentity entry in changelog

holm added a commit to peakon/sequelize that referenced this issue Aug 19, 2016

Backport: Add option to restart identity when truncate (sequelize#6417)
Issue sequelize#5356

  - update query interface with option restartIdentity
  - add test for option restartIdentity
  - update documentation for option restartIdentity with truncate
  - add restartIdentity entry in changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment