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. --- store/sql_upgrade.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'store/sql_upgrade.go') diff --git a/store/sql_upgrade.go b/store/sql_upgrade.go index 7ee7ea199..824d0c3f0 100644 --- a/store/sql_upgrade.go +++ b/store/sql_upgrade.go @@ -201,6 +201,11 @@ func UpgradeDatabaseToVersion35(sqlStore *SqlStore) { // The rest of the migration from Filenames -> FileIds is done lazily in api.GetFileInfosForPost sqlStore.CreateColumnIfNotExists("Posts", "FileIds", "varchar(150)", "varchar(150)", "[]") + // Increase maximum length of the Channel table Purpose column. + if sqlStore.GetMaxLengthOfColumnIfExists("Channels", "Purpose") != "250" { + sqlStore.AlterColumnTypeIfExists("Channels", "Purpose", "varchar(250)", "varchar(250)") + } + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // UNCOMMENT WHEN WE DO RELEASE // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -- cgit v1.2.3-1-g7c22