Fix for error with thread message number increment on MySQL
parent
c76d422768
commit
5c247fc73d
|
@ -250,9 +250,9 @@ class Thread {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_lastMessageNumberInThreadSQL() {
|
_lastMessageNumberInThreadSQL() {
|
||||||
return knex('thread_messages')
|
return knex('thread_messages AS tm_msg_num_ref')
|
||||||
.select(knex.raw('MAX(message_number)'))
|
.select(knex.raw('MAX(tm_msg_num_ref.message_number)'))
|
||||||
.whereRaw(`thread_messages.thread_id = '${this.id}'`)
|
.whereRaw(`tm_msg_num_ref.thread_id = '${this.id}'`)
|
||||||
.toSQL()
|
.toSQL()
|
||||||
.sql;
|
.sql;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue