summaryrefslogtreecommitdiffstats
path: root/store/sql_post_store.go
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-11-05 23:32:44 +0100
committerFlorian Orben <florian.orben@gmail.com>2015-11-05 23:33:21 +0100
commitb085bc2d56bdc98101b8cb50848aee248d42af28 (patch)
tree9e19e790ed53aa1fbaa4b5c0c5574e03ae801577 /store/sql_post_store.go
parent4b6eb56415c2085bc9078836b70b833b1e01a60d (diff)
downloadchat-b085bc2d56bdc98101b8cb50848aee248d42af28.tar.gz
chat-b085bc2d56bdc98101b8cb50848aee248d42af28.tar.bz2
chat-b085bc2d56bdc98101b8cb50848aee248d42af28.zip
PLT-857: Support for Incoming Webhooks - Try #2
Diffstat (limited to 'store/sql_post_store.go')
-rw-r--r--store/sql_post_store.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index fdae20f60..61cd109a1 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -9,8 +9,10 @@ import (
"strconv"
"strings"
+ l4g "code.google.com/p/log4go"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
+ "time"
)
type SqlPostStore struct {
@@ -38,6 +40,15 @@ func NewSqlPostStore(sqlStore *SqlStore) PostStore {
}
func (s SqlPostStore) UpgradeSchemaIfNeeded() {
+ col := s.GetColumnInformation("Posts", "Props")
+ if col.Type != "text" {
+ _, err := s.GetMaster().Exec("ALTER TABLE Posts MODIFY COLUMN Props TEXT")
+ 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() {