move valet feature switch to DB from config

Этот коммит содержится в:
JoramWilander
2015-06-17 12:07:35 -04:00
родитель 5a8f839716
Коммит 799215ee22
9 изменённых файлов: 51 добавлений и 17 удалений

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

@@ -5,6 +5,7 @@ package store
import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"strings"
)
@@ -29,6 +30,11 @@ func NewSqlTeamStore(sqlStore *SqlStore) TeamStore {
}
func (s SqlTeamStore) UpgradeSchemaIfNeeded() {
defaultValue := "0"
if utils.Cfg.TeamSettings.AllowValetDefault {
defaultValue = "1"
}
s.CreateColumnIfNotExists("Teams", "AllowValet", "AllowedDomains", "tinyint(1)", defaultValue)
}
func (s SqlTeamStore) CreateIndexesIfNotExists() {