Skip to content

Commit 724a6bc

Browse files
committed
createdAt DESC with quotation marks did not work with MySQL fixes #565
1 parent a99cac0 commit 724a6bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/models/revision.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ module.exports = function (sequelize, DataTypes) {
110110
where: {
111111
noteId: note.id
112112
},
113-
order: '"createdAt" DESC'
113+
order: [['createdAt', 'DESC']]
114114
}).then(function (revisions) {
115115
var data = []
116116
for (var i = 0, l = revisions.length; i < l; i++) {
@@ -131,7 +131,7 @@ module.exports = function (sequelize, DataTypes) {
131131
where: {
132132
noteId: note.id
133133
},
134-
order: '"createdAt" DESC'
134+
order: [['createdAt', 'DESC']]
135135
}).then(function (revisions) {
136136
if (revisions.length <= 0) return callback(null, null)
137137
// measure target revision position
@@ -142,7 +142,7 @@ module.exports = function (sequelize, DataTypes) {
142142
$gte: time
143143
}
144144
},
145-
order: '"createdAt" DESC'
145+
order: [['createdAt', 'DESC']]
146146
}).then(function (count) {
147147
if (count <= 0) return callback(null, null)
148148
sendDmpWorker({
@@ -231,7 +231,7 @@ module.exports = function (sequelize, DataTypes) {
231231
where: {
232232
noteId: note.id
233233
},
234-
order: '"createdAt" DESC'
234+
order: [['createdAt', 'DESC']]
235235
}).then(function (revisions) {
236236
if (revisions.length <= 0) {
237237
// if no revision available

0 commit comments

Comments
 (0)