diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-02-03 18:34:20 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-02-03 18:34:20 -0500 |
commit | 30cd39ae057743e72263b6893b97ba7dbecf0f8e (patch) | |
tree | a18ea98af35eb5ca947390caf956f49fba107805 /store | |
parent | 7ff2aef7facdeb025a1651ef411fceb3d81932c1 (diff) | |
download | chat-30cd39ae057743e72263b6893b97ba7dbecf0f8e.tar.gz chat-30cd39ae057743e72263b6893b97ba7dbecf0f8e.tar.bz2 chat-30cd39ae057743e72263b6893b97ba7dbecf0f8e.zip |
Removing parentId from delete post queries (#5298)
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_post_store.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go index 96cfc071e..ae7a3c2c0 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -304,7 +304,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()) } @@ -322,7 +322,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()) } |