Этот коммит содержится в:
Christopher Speller
2015-11-09 15:25:41 -05:00
родитель b0fde13147
Коммит bb96157960
4 изменённых файлов: 0 добавлений и 73 удалений

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

@@ -9,10 +9,8 @@ import (
"strconv"
"strings"
l4g "code.google.com/p/log4go"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"time"
)
type SqlPostStore struct {
@@ -40,21 +38,6 @@ func NewSqlPostStore(sqlStore *SqlStore) PostStore {
}
func (s SqlPostStore) UpgradeSchemaIfNeeded() {
colType := s.GetColumnDataType("Posts", "Props")
if colType != "text" {
query := "ALTER TABLE Posts MODIFY COLUMN Props TEXT"
if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
query = "ALTER TABLE Posts ALTER COLUMN Props TYPE text"
}
_, err := s.GetMaster().Exec(query)
if err != nil {
l4g.Critical("Failed to alter column Posts.Props to TEXT: " + err.Error())
time.Sleep(time.Second)
panic("Failed to alter column Posts.Props to TEXT: " + err.Error())
}
}
}
func (s SqlPostStore) CreateIndexesIfNotExists() {