diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-11-04 17:20:21 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-04 17:20:21 -0400 |
commit | 18745b2d5c1899bc279696548cb3ebecf7c6b90f (patch) | |
tree | 23cf9a3f8a75a89970792dd6ce0ff5b26df82850 /store | |
parent | 20254073cb9976e783875f997a291829e6a0d78d (diff) | |
download | chat-18745b2d5c1899bc279696548cb3ebecf7c6b90f.tar.gz chat-18745b2d5c1899bc279696548cb3ebecf7c6b90f.tar.bz2 chat-18745b2d5c1899bc279696548cb3ebecf7c6b90f.zip |
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.
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_channel_store.go | 2 | ||||
-rw-r--r-- | store/sql_upgrade.go | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 8b77ab6ff..5107a0bd8 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -38,7 +38,7 @@ func NewSqlChannelStore(sqlStore *SqlStore) ChannelStore { table.ColMap("Name").SetMaxSize(64) table.SetUniqueTogether("Name", "TeamId") table.ColMap("Header").SetMaxSize(1024) - table.ColMap("Purpose").SetMaxSize(128) + table.ColMap("Purpose").SetMaxSize(250) table.ColMap("CreatorId").SetMaxSize(26) tablem := db.AddTableWithName(model.ChannelMember{}, "ChannelMembers").SetKeys(false, "ChannelId", "UserId") 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 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |