From 020043a18ea80e76280ba7ac85fa5a1da9fbcca5 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 3 Feb 2017 18:34:09 -0500 Subject: [PATCH] Removing parentId from delete post queries (#5297) --- store/sql_post_store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/sql_post_store.go b/store/sql_post_store.go index c1aaee3e6cc..3412c1e63b5 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -282,7 +282,7 @@ func (s SqlPostStore) Delete(postId string, time int64) StoreChannel { go func() { result := StoreResult{} - _, err := s.GetMaster().Exec("Update Posts SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id OR ParentId = :ParentId OR RootId = :RootId", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": postId, "ParentId": postId, "RootId": postId}) + _, err := s.GetMaster().Exec("Update Posts SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id OR RootId = :RootId", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": postId, "RootId": postId}) if err != nil { result.Err = model.NewLocAppError("SqlPostStore.Delete", "store.sql_post.delete.app_error", nil, "id="+postId+", err="+err.Error()) } @@ -300,7 +300,7 @@ func (s SqlPostStore) permanentDelete(postId string) StoreChannel { go func() { result := StoreResult{} - _, err := s.GetMaster().Exec("DELETE FROM Posts WHERE Id = :Id OR ParentId = :ParentId OR RootId = :RootId", map[string]interface{}{"Id": postId, "ParentId": postId, "RootId": postId}) + _, err := s.GetMaster().Exec("DELETE FROM Posts WHERE Id = :Id OR RootId = :RootId", map[string]interface{}{"Id": postId, "RootId": postId}) if err != nil { result.Err = model.NewLocAppError("SqlPostStore.Delete", "store.sql_post.permanent_delete.app_error", nil, "id="+postId+", err="+err.Error()) }