fix(db): fix order in some cases for future db structure

This commit is contained in:
Alexey Kasyanchuk
2021-06-15 14:15:46 +03:00
parent 0e79ce42ca
commit b4c2627ed5

View File

@ -5,7 +5,7 @@ module.exports = (sphinx, table, callback, doneCallback, max = 1000, where = '',
doneCallback(true)
done(true)
}
const data = await sphinx.query(`SELECT * FROM ${table} WHERE id > ${index} ${where} LIMIT ${max}`);
const data = await sphinx.query(`SELECT * FROM ${table} WHERE id > ${index} ${where} ORDER BY id ASC LIMIT ${max}`);
if(data.length == 0) {
finish()
return;