diff options
author | Martin Kraft <mkraft@users.noreply.github.com> | 2018-01-26 08:37:12 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-01-26 08:37:12 -0500 |
commit | 540dd9ae942787279c2fe439a9182223c1a11d2c (patch) | |
tree | b0c75353c94b2eda4a54550a53456b9d53c3c34e /store | |
parent | 3da2dad98935a4a08a4884d352280c814c86de84 (diff) | |
download | chat-540dd9ae942787279c2fe439a9182223c1a11d2c.tar.gz chat-540dd9ae942787279c2fe439a9182223c1a11d2c.tar.bz2 chat-540dd9ae942787279c2fe439a9182223c1a11d2c.zip |
XYZ-32: Increases size of position to 128 characters. (#8148)
* XYZ-32: Changes type of 'position' column on 'users' table.
* XYZ-32: Uncomment to run on CI and pre-release.
* XYZ-32: Reverts translation changes.
* XYZ-32: Fix for gofmt.
Diffstat (limited to 'store')
-rw-r--r-- | store/sqlstore/upgrade.go | 18 | ||||
-rw-r--r-- | store/sqlstore/user_store.go | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index 4095e4cac..7f38e3a73 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -15,6 +15,7 @@ import ( ) const ( + VERSION_4_7_0 = "4.7.0" VERSION_4_6_0 = "4.6.0" VERSION_4_5_0 = "4.5.0" VERSION_4_4_0 = "4.4.0" @@ -62,6 +63,7 @@ func UpgradeDatabase(sqlStore SqlStore) { UpgradeDatabaseToVersion44(sqlStore) UpgradeDatabaseToVersion45(sqlStore) UpgradeDatabaseToVersion46(sqlStore) + UpgradeDatabaseToVersion47(sqlStore) // If the SchemaVersion is empty this this is the first time it has ran // so lets set it to the current version. @@ -324,8 +326,13 @@ func UpgradeDatabaseToVersion44(sqlStore SqlStore) { } } -func UpgradeDatabaseToVersion46(sqlStore SqlStore) { +func UpgradeDatabaseToVersion45(sqlStore SqlStore) { + if shouldPerformUpgrade(sqlStore, VERSION_4_4_0, VERSION_4_5_0) { + saveSchemaVersion(sqlStore, VERSION_4_5_0) + } +} +func UpgradeDatabaseToVersion46(sqlStore SqlStore) { if shouldPerformUpgrade(sqlStore, VERSION_4_5_0, VERSION_4_6_0) { sqlStore.CreateColumnIfNotExists("IncomingWebhooks", "Username", "varchar(64)", "varchar(64)", "") sqlStore.CreateColumnIfNotExists("IncomingWebhooks", "IconURL", "varchar(1024)", "varchar(1024)", "") @@ -333,8 +340,9 @@ func UpgradeDatabaseToVersion46(sqlStore SqlStore) { } } -func UpgradeDatabaseToVersion45(sqlStore SqlStore) { - if shouldPerformUpgrade(sqlStore, VERSION_4_4_0, VERSION_4_5_0) { - saveSchemaVersion(sqlStore, VERSION_4_5_0) - } +func UpgradeDatabaseToVersion47(sqlStore SqlStore) { + // if shouldPerformUpgrade(sqlStore, VERSION_4_6_0, VERSION_4_7_0) { + sqlStore.AlterColumnTypeIfExists("Users", "Position", "varchar(128)", "varchar(128)") + // saveSchemaVersion(sqlStore, VERSION_4_7_0) + // } } diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go index 549377d61..d67a45704 100644 --- a/store/sqlstore/user_store.go +++ b/store/sqlstore/user_store.go @@ -69,7 +69,7 @@ func NewSqlUserStore(sqlStore SqlStore, metrics einterfaces.MetricsInterface) st table.ColMap("NotifyProps").SetMaxSize(2000) table.ColMap("Locale").SetMaxSize(5) table.ColMap("MfaSecret").SetMaxSize(128) - table.ColMap("Position").SetMaxSize(64) + table.ColMap("Position").SetMaxSize(128) } return us |