MM-18060: Include deleted posts in compliance export. (#12957)

This commit is contained in:
catalintomai
2019-10-31 09:31:18 -07:00
committed by GitHub
parent f3716caba9
commit 7c658a98f0
2 changed files with 3 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ type MessageExport struct {
PostId *string
PostCreateAt *int64
PostUpdateAt *int64
PostDeleteAt *int64
PostMessage *string
PostType *string
PostRootId *string

View File

@@ -213,6 +213,7 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) ([]*model.Mess
Posts.Id AS PostId,
Posts.CreateAt AS PostCreateAt,
Posts.UpdateAt AS PostUpdateAt,
Posts.DeleteAt AS PostDeleteAt,
Posts.Message AS PostMessage,
Posts.Type AS PostType,
Posts.OriginalId AS PostOriginalId,
@@ -241,7 +242,7 @@ func (s SqlComplianceStore) MessageExport(after int64, limit int) ([]*model.Mess
LEFT OUTER JOIN Users ON Posts.UserId = Users.Id
LEFT JOIN Bots ON Bots.UserId = Posts.UserId
WHERE
(Posts.CreateAt > :StartTime OR Posts.EditAt > :StartTime) AND
(Posts.CreateAt > :StartTime OR Posts.EditAt > :StartTime OR Posts.DeleteAt > :StartTime) AND
Posts.Type = ''
ORDER BY PostUpdateAt
LIMIT :Limit`