Adding ability to upgrade postgres schema

Этот коммит содержится в:
=Corey Hulen
2015-08-27 16:01:17 -07:00
родитель bcde2adde7
Коммит e0bc27a3b4
5 изменённых файлов: 97 добавлений и 101 удалений

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

@@ -5,7 +5,6 @@ package store
import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
type SqlTeamStore struct {
@@ -29,15 +28,6 @@ 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)
if !s.DoesColumnExist("Teams", "DisplayName") {
s.RenameColumnIfExists("Teams", "Name", "DisplayName", "varchar(64)")
s.RenameColumnIfExists("Teams", "Domain", "Name", "varchar(64)")
}
}
func (s SqlTeamStore) CreateIndexesIfNotExists() {