Skip to content

Commit

Permalink
Removing parentId from delete post queries
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller committed Feb 3, 2017
1 parent b265bc2 commit 9e2fff2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/sql_post_store.go
Expand Up @@ -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())
}
Expand All @@ -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())
}
Expand Down

0 comments on commit 9e2fff2

Please sign in to comment.