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