MM-27380 Move collapsed categories to server (#17194)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5e076ea36f
Коммит
b3e0db012b
@@ -47,6 +47,7 @@ type SidebarCategory struct {
|
|||||||
Type SidebarCategoryType `json:"type"`
|
Type SidebarCategoryType `json:"type"`
|
||||||
DisplayName string `json:"display_name"`
|
DisplayName string `json:"display_name"`
|
||||||
Muted bool `json:"muted"`
|
Muted bool `json:"muted"`
|
||||||
|
Collapsed bool `json:"collapsed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SidebarCategoryWithChannels combines data from SidebarCategory table with the Channel IDs that belong to that category
|
// SidebarCategoryWithChannels combines data from SidebarCategory table with the Channel IDs that belong to that category
|
||||||
|
|||||||
@@ -650,6 +650,7 @@ func (s SqlChannelStore) UpdateSidebarCategories(userId, teamId string, categori
|
|||||||
Set("DisplayName", updatedCategory.DisplayName).
|
Set("DisplayName", updatedCategory.DisplayName).
|
||||||
Set("Sorting", updatedCategory.Sorting).
|
Set("Sorting", updatedCategory.Sorting).
|
||||||
Set("Muted", updatedCategory.Muted).
|
Set("Muted", updatedCategory.Muted).
|
||||||
|
Set("Collapsed", updatedCategory.Collapsed).
|
||||||
Where(sq.Eq{"Id": updatedCategory.Id}).ToSql()
|
Where(sq.Eq{"Id": updatedCategory.Id}).ToSql()
|
||||||
|
|
||||||
if _, err = transaction.Exec(updateQuery, updateParams...); err != nil {
|
if _, err = transaction.Exec(updateQuery, updateParams...); err != nil {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
CurrentSchemaVersion = Version5340
|
CurrentSchemaVersion = Version5340
|
||||||
|
Version5350 = "5.35.0"
|
||||||
Version5340 = "5.34.0"
|
Version5340 = "5.34.0"
|
||||||
Version5330 = "5.33.0"
|
Version5330 = "5.33.0"
|
||||||
Version5320 = "5.32.0"
|
Version5320 = "5.32.0"
|
||||||
@@ -204,6 +205,7 @@ func upgradeDatabase(sqlStore *SqlStore, currentModelVersionString string) error
|
|||||||
upgradeDatabaseToVersion532(sqlStore)
|
upgradeDatabaseToVersion532(sqlStore)
|
||||||
upgradeDatabaseToVersion533(sqlStore)
|
upgradeDatabaseToVersion533(sqlStore)
|
||||||
upgradeDatabaseToVersion534(sqlStore)
|
upgradeDatabaseToVersion534(sqlStore)
|
||||||
|
upgradeDatabaseToVersion535(sqlStore)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -1003,3 +1005,12 @@ func upgradeDatabaseToVersion534(sqlStore *SqlStore) {
|
|||||||
saveSchemaVersion(sqlStore, Version5340)
|
saveSchemaVersion(sqlStore, Version5340)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func upgradeDatabaseToVersion535(sqlStore *SqlStore) {
|
||||||
|
// if shouldPerformUpgrade(sqlStore, Version5340, Version5350) {
|
||||||
|
|
||||||
|
sqlStore.CreateColumnIfNotExists("SidebarCategories", "Collapsed", "tinyint(1)", "boolean", "0")
|
||||||
|
|
||||||
|
// saveSchemaVersion(sqlStore, Version5350)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user