fix alter table command for postgres
Этот коммит содержится в:
@@ -42,7 +42,13 @@ func NewSqlPostStore(sqlStore *SqlStore) PostStore {
|
|||||||
func (s SqlPostStore) UpgradeSchemaIfNeeded() {
|
func (s SqlPostStore) UpgradeSchemaIfNeeded() {
|
||||||
colType := s.GetColumnDataType("Posts", "Props")
|
colType := s.GetColumnDataType("Posts", "Props")
|
||||||
if colType != "text" {
|
if colType != "text" {
|
||||||
_, err := s.GetMaster().Exec("ALTER TABLE Posts MODIFY COLUMN Props 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 {
|
if err != nil {
|
||||||
l4g.Critical("Failed to alter column Posts.Props to TEXT: " + err.Error())
|
l4g.Critical("Failed to alter column Posts.Props to TEXT: " + err.Error())
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
|
|||||||
@@ -992,6 +992,7 @@ func incomingWebhook(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
channelName := parsedRequest.ChannelName
|
channelName := parsedRequest.ChannelName
|
||||||
webhookType := parsedRequest.Type
|
webhookType := parsedRequest.Type
|
||||||
|
|
||||||
|
//attachments is in here for slack compatibility
|
||||||
if parsedRequest.Attachments != nil {
|
if parsedRequest.Attachments != nil {
|
||||||
if len(parsedRequest.Props) == 0 {
|
if len(parsedRequest.Props) == 0 {
|
||||||
parsedRequest.Props = make(model.StringInterface)
|
parsedRequest.Props = make(model.StringInterface)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user