diff options
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r-- | store/sql_channel_store.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 80fe75130..2d62b8614 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -25,7 +25,8 @@ func NewSqlChannelStore(sqlStore *SqlStore) ChannelStore { table.ColMap("DisplayName").SetMaxSize(64) table.ColMap("Name").SetMaxSize(64) table.SetUniqueTogether("Name", "TeamId") - table.ColMap("Description").SetMaxSize(1024) + table.ColMap("Header").SetMaxSize(1024) + table.ColMap("Purpose").SetMaxSize(128) table.ColMap("CreatorId").SetMaxSize(26) tablem := db.AddTableWithName(model.ChannelMember{}, "ChannelMembers").SetKeys(false, "ChannelId", "UserId") @@ -83,6 +84,11 @@ func (s SqlChannelStore) UpgradeSchemaIfNeeded() { s.RemoveColumnIfExists("ChannelMembers", "NotifyLevel") } + + // BEGIN REMOVE AFTER 1.2.0 + s.RenameColumnIfExists("Channels", "Description", "Header", "varchar(1024)") + s.CreateColumnIfNotExists("Channels", "Purpose", "varchar(1024)", "varchar(1024)", "") + // END REMOVE AFTER 1.2.0 } func (s SqlChannelStore) CreateIndexesIfNotExists() { @@ -241,7 +247,7 @@ func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel { result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that handle already exists", "id="+channel.Id+", "+err.Error()) } } else { - result.Err = model.NewAppError("SqlChannelStore.Update", "We encounted an error updating the channel", "id="+channel.Id+", "+err.Error()) + result.Err = model.NewAppError("SqlChannelStore.Update", "We encountered an error updating the channel", "id="+channel.Id+", "+err.Error()) } } else if count != 1 { result.Err = model.NewAppError("SqlChannelStore.Update", "We couldn't update the channel", "id="+channel.Id) @@ -291,7 +297,7 @@ func (s SqlChannelStore) Get(id string) StoreChannel { result := StoreResult{} if obj, err := s.GetReplica().Get(model.Channel{}, id); err != nil { - result.Err = model.NewAppError("SqlChannelStore.Get", "We encounted an error finding the channel", "id="+id+", "+err.Error()) + result.Err = model.NewAppError("SqlChannelStore.Get", "We encountered an error finding the channel", "id="+id+", "+err.Error()) } else if obj == nil { result.Err = model.NewAppError("SqlChannelStore.Get", "We couldn't find the existing channel", "id="+id) } else { @@ -531,7 +537,7 @@ func (s SqlChannelStore) UpdateMember(member *model.ChannelMember) StoreChannel } if _, err := s.GetMaster().Update(member); err != nil { - result.Err = model.NewAppError("SqlChannelStore.UpdateMember", "We encounted an error updating the channel member", + result.Err = model.NewAppError("SqlChannelStore.UpdateMember", "We encountered an error updating the channel member", "channel_id="+member.ChannelId+", "+"user_id="+member.UserId+", "+err.Error()) } else { result.Data = member |