diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-07-27 17:04:44 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-07-27 17:04:44 -0400 |
commit | e122b31db1306bf42b1c0265a1f0a57e43153e54 (patch) | |
tree | 915354bfb43c563c7013ebbb97482f17586873eb /store/sql_channel_store.go | |
parent | 62db88ed456148750cd6990ffc02e660af53ef91 (diff) | |
download | chat-e122b31db1306bf42b1c0265a1f0a57e43153e54.tar.gz chat-e122b31db1306bf42b1c0265a1f0a57e43153e54.tar.bz2 chat-e122b31db1306bf42b1c0265a1f0a57e43153e54.zip |
fixes some database queries that broke with postgres, fixes the unread/new mesasge issues
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r-- | store/sql_channel_store.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |