mirror of https://github.com/status-im/codimd.git
Merge pull request #566 from ccoenen/fix-mysql-revision-order
createdAt DESC with quotation marks did not work with MySQL fixes #565
This commit is contained in:
commit
4dd60cee50
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue