Skip to content

Fixes #4840, Model.count allow passing col to count on - #6114

Merged
janmeier merged 1 commit into
sequelize:masterfrom
sushantdhiman:fix-4840
Jun 15, 2016
Merged

janmeier merged 1 commit into
sequelize:masterfrom
sushantdhiman:fix-4840

Conversation

@sushantdhiman

Copy link
Copy Markdown
Contributor

Pull Request check-list

  • 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

Closes #4442
Fixes #4840
Closes #3740

distinct option with Model.count was broken because it generates a SQL query like

COUNT( DISTINCT(*) ) which is incorrect.

As noted in issues mentioned above, we should allow an option to pass the col so distinct can work as expected.

PR #3740 can be closed because #3019 is closed and missing Model.count paranoid documentation is added in this PR

@janmeier
janmeier merged commit 6326cb1 into sequelize:master Jun 15, 2016
@janmeier

Copy link
Copy Markdown
Member

Sweet! :)

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.

Is distinct option for Model.count() actually working? Specify the column for .count

2 participants