Skip to content

Commit

Permalink
Stop updating msgs_msg.delete_reason which is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Feb 21, 2022
1 parent 4ce0680 commit 12b8714
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions archives/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ WHERE mm.org_id = $1 AND mm.created_on >= $2 AND mm.created_on < $3
ORDER BY mm.created_on ASC, mm.id ASC
`

const setMessageDeleteReason = `
UPDATE msgs_msg
SET delete_reason = 'A'
WHERE id IN(?)
`

const deleteMessageLogs = `
DELETE FROM channels_channellog
WHERE msg_id IN(?)
Expand Down Expand Up @@ -206,13 +200,7 @@ func DeleteArchivedMessages(ctx context.Context, config *Config, db *sqlx.DB, s3
return err
}

// first update our delete_reason
err = executeInQuery(ctx, tx, setMessageDeleteReason, idBatch)
if err != nil {
return errors.Wrap(err, "error updating delete reason")
}

// now delete any channel logs
// first delete any channel logs
err = executeInQuery(ctx, tx, deleteMessageLogs, idBatch)
if err != nil {
return errors.Wrap(err, "error removing channel logs")
Expand Down

0 comments on commit 12b8714

Please sign in to comment.