summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheogorath2017-10-11 01:08:16 +0200
committerGitHub2017-10-11 01:08:16 +0200
commit4dd60cee50362646dc87101e66ac326560d2580f (patch)
tree81c07bc7c558c94fe0c7f6baaf58dd019c81edd7
parent87ac05738ff82c7e32557d5fb0a92fe0942e7fbc (diff)
parent724a6bc26f20c47421b1d14b25e4062f3807dbc5 (diff)
Merge pull request #566 from ccoenen/fix-mysql-revision-order
createdAt DESC with quotation marks did not work with MySQL fixes #565
Diffstat (limited to '')
-rw-r--r--lib/models/revision.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/models/revision.js b/lib/models/revision.js
index 6f3a746f..225a95d4 100644
--- a/lib/models/revision.js
+++ b/lib/models/revision.js
@@ -110,7 +110,7 @@ module.exports = function (sequelize, DataTypes) {
where: {
noteId: note.id
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (revisions) {
var data = []
for (var i = 0, l = revisions.length; i < l; i++) {
@@ -131,7 +131,7 @@ module.exports = function (sequelize, DataTypes) {
where: {
noteId: note.id
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (revisions) {
if (revisions.length <= 0) return callback(null, null)
// measure target revision position
@@ -142,7 +142,7 @@ module.exports = function (sequelize, DataTypes) {
$gte: time
}
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (count) {
if (count <= 0) return callback(null, null)
sendDmpWorker({
@@ -231,7 +231,7 @@ module.exports = function (sequelize, DataTypes) {
where: {
noteId: note.id
},
- order: '"createdAt" DESC'
+ order: [['createdAt', 'DESC']]
}).then(function (revisions) {
if (revisions.length <= 0) {
// if no revision available