From e122b31db1306bf42b1c0265a1f0a57e43153e54 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 27 Jul 2015 17:04:44 -0400 Subject: fixes some database queries that broke with postgres, fixes the unread/new mesasge issues --- store/sql_channel_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'store/sql_channel_store.go') diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 8961d5d97..f64558a92 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -120,7 +120,7 @@ func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel { if count, err := s.GetMaster().Update(channel); err != nil { if IsUniqueConstraintError(err.Error(), "Name", "channels_name_teamid_key") { dupChannel := model.Channel{} - s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId=? AND Name=? AND DeleteAt > 0", channel.TeamId, channel.Name) + s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId = :TeamId AND Name= :Name AND DeleteAt > 0", map[string]interface{}{"TeamId": channel.TeamId, "Name": channel.Name}) if dupChannel.DeleteAt > 0 { result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that name was previously created", "id="+channel.Id+", "+err.Error()) } else { -- cgit v1.2.3-1-g7c22