Skip to content

Close #5356 : Add option to restart identity when truncate - #6415

Merged
janmeier merged 4 commits into
sequelize:masterfrom
gouroujo:master
Aug 11, 2016
Merged

janmeier merged 4 commits into
sequelize:masterfrom
gouroujo:master

Conversation

@gouroujo

Copy link
Copy Markdown
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does your issue contain a link to existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Have you added an entry under Future in the changelog?

Description of change

Model.truncate() is optionally allow to reset the sequence of the primary key
by passing the option restartIdentity to true.

 TRUNCATE table_name RESTART IDENTITY;

This change is only for Postgres because MySQL and SSQL already restart the counter when you truncate a table.

@gouroujo gouroujo changed the title Close #5356 : Add option Close #5356 : Add option to restart identity when truncate Aug 11, 2016
@janmeier

Copy link
Copy Markdown
Member

LGTM

@sushantdhiman

Copy link
Copy Markdown
Contributor

LGTM, It will close #5356

@felixfbecker

Copy link
Copy Markdown
Contributor

Can you also backport this to v3? ❤️

@gouroujo

Copy link
Copy Markdown
Contributor Author

I'm not sure what I have to add to changelog.md to complete the last item in the checklist

@janmeier

Copy link
Copy Markdown
Member

Something like - [Added]restartIdentityoption for truncate in postgres [#5356](https://github.com/sequelize/sequelize/issues/5356)

@sushantdhiman

Copy link
Copy Markdown
Contributor

Also you can prefix your commit message with [ci skip] to skip Travis CI

@sushantdhiman

Copy link
Copy Markdown
Contributor

I guess I was too late :)

@janmeier

janmeier commented Aug 11, 2016 •

Copy link
Copy Markdown
Member

Yeah, I cancelled the build manually ;)

@janmeier
janmeier merged commit e6d6f39 into sequelize:master Aug 11, 2016
@gouroujo

Copy link
Copy Markdown
Contributor Author

sorry @sushantdhiman ! thx @janmeier

@felixfbecker

Copy link
Copy Markdown
Contributor

@gouroujo will you backport this? Otherwise I would do it 🙂

@gouroujo

Copy link
Copy Markdown
Contributor Author

@felixfbecker feel free to backport it ! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants