-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
regressionFor issues and PRs. A bug that does not happen in an earlier version of Sequelize.For issues and PRs. A bug that does not happen in an earlier version of Sequelize.type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type
Description
This code used to work in v3.14.2
var Sequelize = require('Sequelize');
var connection = new Sequelize("postgres://postgres:admin@localhost:5432/app_db");
var Download = connection.define('download', {
id: {type: Sequelize.UUID, primaryKey: true},
type: {type: Sequelize.INTEGER},
user: {type: Sequelize.UUID},
createdAt: {
field: 'created_at',
type: Sequelize.DATE
},
updatedAt: {
field: 'updated_at',
type: Sequelize.DATE
}
}, {
underscored: true,
tableName: 'downloads'
});
Download.count({
attributes: [
[Sequelize.literal('date_part(\'month\', "created_at" at TIME ZONE INTERVAL \'+03:00\')'), 'd_month']
],
group: ['d_month']
}).then(function(result) {
console.log(result);
}).done();The generated SQL output was:
SELECT date_part('month', "created_at" at TIME ZONE INTERVAL '+03:00') AS "d_month", count(*) AS "count" FROM "downloads" AS "download" GROUP BY "d_month";In 3.15.0 the same code results in error, generated SQL output doesn't include custom attributes
SELECT count(*) AS "count" FROM "downloads" AS "download" GROUP BY "d_month";Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
regressionFor issues and PRs. A bug that does not happen in an earlier version of Sequelize.For issues and PRs. A bug that does not happen in an earlier version of Sequelize.type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type