Simplification of a Channel Members query. (#8345)

This commit is contained in:
George Goldberg
2018-02-28 23:07:09 +00:00
committed by Joram Wilander
parent 600528e1cf
commit d2b70b8671

View File

@@ -946,9 +946,9 @@ func (s SqlChannelStore) GetAllChannelMembersNotifyPropsForChannel(channelId str
var data []allChannelMemberNotifyProps
_, err := s.GetReplica().Select(&data, `
SELECT ChannelMembers.UserId, ChannelMembers.NotifyProps
FROM Channels, ChannelMembers
WHERE Channels.Id = ChannelMembers.ChannelId AND ChannelMembers.ChannelId = :ChannelId`, map[string]interface{}{"ChannelId": channelId})
SELECT UserId, NotifyProps
FROM ChannelMembers
WHERE ChannelId = :ChannelId`, map[string]interface{}{"ChannelId": channelId})
if err != nil {
result.Err = model.NewAppError("SqlChannelStore.GetAllChannelMembersPropsForChannel", "store.sql_channel.get_members.app_error", nil, "channelId="+channelId+", err="+err.Error(), http.StatusInternalServerError)