Delete before forced bulk insert to fix broken migrations
This commit is contained in:
parent
4d5894bf04
commit
0d13d437fe
2 changed files with 23 additions and 1 deletions
|
@ -37,6 +37,7 @@ module.exports = {
|
|||
saveMessage,
|
||||
saveMessages,
|
||||
removeMessage,
|
||||
_removeMessages,
|
||||
getUnreadByConversation,
|
||||
|
||||
removeAllMessagesInConversation,
|
||||
|
@ -220,6 +221,11 @@ async function removeMessage(id, { Message }) {
|
|||
}
|
||||
}
|
||||
|
||||
// Note: this method will not clean up external files, just delete from SQL
|
||||
async function _removeMessages(ids) {
|
||||
await channels.removeMessage(ids);
|
||||
}
|
||||
|
||||
async function getMessageById(id, { Message }) {
|
||||
const message = await channels.getMessageById(id);
|
||||
return new Message(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue