Skip to content

Commit

Permalink
use "as" value rather than the real name
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Ferrero committed Jan 11, 2022
1 parent 976e831 commit d3f895c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/moleculer-db-adapter-sequelize/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class SequelizeDbAdapter {
* @returns {Promise}
*/
createCursor(params, isCounting) {
const strictCountRule = { distinct: true, col: `${this.model.tableName}.${this.model.primaryKeyAttribute}` };
const strictCountRule = { distinct: true, col: `${this.model.name ||this.model.tableName}.${this.model.primaryKeyAttribute}` };
if (!params) {
if (isCounting)
return this.model.count(strictCountRule);
Expand Down

0 comments on commit d3f895c

Please sign in to comment.