MM-31401 Add Shared flag to Channels table (#16568)

* add Shared flag to Channels table
Этот коммит содержится в:
Doug Lauder
2020-12-16 14:02:16 -05:00
коммит произвёл GitHub
родитель 2447ce9bca
Коммит 6a3bc50f13
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@@ -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)
// }
}