diff options
-rw-r--r-- | model/incoming_webhook.go | 2 | ||||
-rw-r--r-- | model/incoming_webhook_test.go | 4 | ||||
-rw-r--r-- | model/outgoing_webhook.go | 2 | ||||
-rw-r--r-- | model/outgoing_webhook_test.go | 6 | ||||
-rw-r--r-- | store/sqlstore/upgrade.go | 3 | ||||
-rw-r--r-- | store/sqlstore/webhook_store.go | 4 |
6 files changed, 11 insertions, 10 deletions
diff --git a/model/incoming_webhook.go b/model/incoming_webhook.go index 1d6d7b4f0..3856d22ff 100644 --- a/model/incoming_webhook.go +++ b/model/incoming_webhook.go @@ -93,7 +93,7 @@ func (o *IncomingWebhook) IsValid() *AppError { return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.display_name.app_error", nil, "", http.StatusBadRequest) } - if len(o.Description) > 128 { + if len(o.Description) > 500 { return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.description.app_error", nil, "", http.StatusBadRequest) } diff --git a/model/incoming_webhook_test.go b/model/incoming_webhook_test.go index 5498a6a0c..3f7d13695 100644 --- a/model/incoming_webhook_test.go +++ b/model/incoming_webhook_test.go @@ -80,12 +80,12 @@ func TestIncomingWebhookIsValid(t *testing.T) { t.Fatal(err) } - o.Description = strings.Repeat("1", 129) + o.Description = strings.Repeat("1", 501) if err := o.IsValid(); err == nil { t.Fatal("should be invalid") } - o.Description = strings.Repeat("1", 128) + o.Description = strings.Repeat("1", 500) if err := o.IsValid(); err != nil { t.Fatal(err) } diff --git a/model/outgoing_webhook.go b/model/outgoing_webhook.go index 698a226e3..5f7a67d04 100644 --- a/model/outgoing_webhook.go +++ b/model/outgoing_webhook.go @@ -171,7 +171,7 @@ func (o *OutgoingWebhook) IsValid() *AppError { return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.display_name.app_error", nil, "", http.StatusBadRequest) } - if len(o.Description) > 128 { + if len(o.Description) > 500 { return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.description.app_error", nil, "", http.StatusBadRequest) } diff --git a/model/outgoing_webhook_test.go b/model/outgoing_webhook_test.go index 3241e649f..5403fca6f 100644 --- a/model/outgoing_webhook_test.go +++ b/model/outgoing_webhook_test.go @@ -102,14 +102,14 @@ func TestOutgoingWebhookIsValid(t *testing.T) { t.Fatal(err) } - o.Description = strings.Repeat("1", 129) + o.Description = strings.Repeat("1", 501) if err := o.IsValid(); err == nil { t.Fatal("should be invalid") } - o.Description = strings.Repeat("1", 128) + o.Description = strings.Repeat("1", 500) if err := o.IsValid(); err != nil { - t.Fatal("should be invalid") + t.Fatal(err) } o.ContentType = strings.Repeat("1", 129) diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index ab3bd202b..4d7d4addc 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -486,7 +486,8 @@ func UpgradeDatabaseToVersion52(sqlStore SqlStore) { func UpgradeDatabaseToVersion53(sqlStore SqlStore) { // TODO: Uncomment following condition when version 5.3.0 is released // if shouldPerformUpgrade(sqlStore, VERSION_5_2_0, VERSION_5_3_0) { - + sqlStore.AlterColumnTypeIfExists("OutgoingWebhooks", "Description", "varchar(500)", "varchar(500)") + sqlStore.AlterColumnTypeIfExists("IncomingWebhooks", "Description", "varchar(500)", "varchar(500)") // saveSchemaVersion(sqlStore, VERSION_5_3_0) // } } diff --git a/store/sqlstore/webhook_store.go b/store/sqlstore/webhook_store.go index f3c572aaf..94eadf836 100644 --- a/store/sqlstore/webhook_store.go +++ b/store/sqlstore/webhook_store.go @@ -47,7 +47,7 @@ func NewSqlWebhookStore(sqlStore SqlStore, metrics einterfaces.MetricsInterface) table.ColMap("ChannelId").SetMaxSize(26) table.ColMap("TeamId").SetMaxSize(26) table.ColMap("DisplayName").SetMaxSize(64) - table.ColMap("Description").SetMaxSize(128) + table.ColMap("Description").SetMaxSize(500) tableo := db.AddTableWithName(model.OutgoingWebhook{}, "OutgoingWebhooks").SetKeys(false, "Id") tableo.ColMap("Id").SetMaxSize(26) @@ -58,7 +58,7 @@ func NewSqlWebhookStore(sqlStore SqlStore, metrics einterfaces.MetricsInterface) tableo.ColMap("TriggerWords").SetMaxSize(1024) tableo.ColMap("CallbackURLs").SetMaxSize(1024) tableo.ColMap("DisplayName").SetMaxSize(64) - tableo.ColMap("Description").SetMaxSize(128) + tableo.ColMap("Description").SetMaxSize(500) tableo.ColMap("ContentType").SetMaxSize(128) tableo.ColMap("TriggerWhen").SetMaxSize(1) tableo.ColMap("Username").SetMaxSize(64) |