From 18745b2d5c1899bc279696548cb3ebecf7c6b90f Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 4 Nov 2016 17:20:21 -0400 Subject: Increase Channel Purpose length to 250, and add channel field length handling code to the slack importer (#4458) * Increase Channel Purpose length to 250. This commit increases the maxmimum length of the channel purpose field to 250, including the database migration necessary. It also adds a method to the Slack importer to check the lengths of channel properties before importing, and truncate them if necessary. Fixes #4168 * Fix database migration. --- model/channel_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'model/channel_test.go') diff --git a/model/channel_test.go b/model/channel_test.go index 590417cfe..af4e3c16d 100644 --- a/model/channel_test.go +++ b/model/channel_test.go @@ -78,7 +78,7 @@ func TestChannelIsValid(t *testing.T) { t.Fatal(err) } - o.Purpose = strings.Repeat("01234567890", 20) + o.Purpose = strings.Repeat("01234567890", 30) if err := o.IsValid(); err == nil { t.Fatal("should be invalid") } @@ -87,6 +87,11 @@ func TestChannelIsValid(t *testing.T) { if err := o.IsValid(); err != nil { t.Fatal(err) } + + o.Purpose = strings.Repeat("0123456789", 25) + if err := o.IsValid(); err != nil { + t.Fatal(err) + } } func TestChannelPreSave(t *testing.T) { -- cgit v1.2.3-1-g7c22