MM-31401 Add Shared flag to Channels table (#16568)
* add Shared flag to Channels table
Этот коммит содержится в:
@@ -51,6 +51,7 @@ type Channel struct {
|
||||
SchemeId *string `json:"scheme_id"`
|
||||
Props map[string]interface{} `json:"props" db:"-"`
|
||||
GroupConstrained *bool `json:"group_constrained"`
|
||||
Shared *bool `json:"shared"`
|
||||
}
|
||||
|
||||
type ChannelWithTeamData struct {
|
||||
@@ -313,6 +314,10 @@ func (o *Channel) IsGroupConstrained() bool {
|
||||
return o.GroupConstrained != nil && *o.GroupConstrained
|
||||
}
|
||||
|
||||
func (o *Channel) IsShared() bool {
|
||||
return o.Shared != nil && *o.Shared
|
||||
}
|
||||
|
||||
func (o *Channel) GetOtherUserIdForDM(userId string) string {
|
||||
if o.Type != CHANNEL_DIRECT {
|
||||
return ""
|
||||
|
||||
@@ -956,6 +956,7 @@ func upgradeDatabaseToVersion531(sqlStore *SqlStore) {
|
||||
// if shouldPerformUpgrade(sqlStore, VERSION_5_30_0, VERSION_5_31_0) {
|
||||
// allow 10 files per post
|
||||
sqlStore.AlterColumnTypeIfExists("Posts", "FileIds", "text", "varchar(300)")
|
||||
sqlStore.CreateColumnIfNotExistsNoDefault("Channels", "Shared", "tinyint(1)", "boolean")
|
||||
// saveSchemaVersion(sqlStore, VERSION_5_31_0)
|
||||
// }
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user