diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-12-01 15:20:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-01 15:20:08 -0500 |
commit | c3af8785734803b6199a28249537ef3e47fe4caa (patch) | |
tree | 8260b673bf1da0a41bd5a8375b5d28789ebefa7d /store | |
parent | 739d91f21387448f0071f06675fb71c7625fa46a (diff) | |
download | chat-c3af8785734803b6199a28249537ef3e47fe4caa.tar.gz chat-c3af8785734803b6199a28249537ef3e47fe4caa.tar.bz2 chat-c3af8785734803b6199a28249537ef3e47fe4caa.zip |
Hash key for plugin store table and limit plugin ID length (#7915)
* Hash plugin store keys and update column limits
* Limit plugin ID length on install
* Add note to manifest id and allow zero length keys
Diffstat (limited to 'store')
-rw-r--r-- | store/sqlstore/plugin_store.go | 4 | ||||
-rw-r--r-- | store/sqlstore/upgrade.go | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/store/sqlstore/plugin_store.go b/store/sqlstore/plugin_store.go index a4b49cb27..66a082cdf 100644 --- a/store/sqlstore/plugin_store.go +++ b/store/sqlstore/plugin_store.go @@ -21,8 +21,8 @@ func NewSqlPluginStore(sqlStore SqlStore) store.PluginStore { for _, db := range sqlStore.GetAllConns() { table := db.AddTableWithName(model.PluginKeyValue{}, "PluginKeyValueStore").SetKeys(false, "PluginId", "Key") - table.ColMap("PluginId").SetMaxSize(100) - table.ColMap("Key").SetMaxSize(100) + table.ColMap("PluginId").SetMaxSize(200) + table.ColMap("Key").SetMaxSize(50) table.ColMap("Value").SetMaxSize(8192) } diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index d10235135..55a408c7f 100644 --- a/store/sqlstore/upgrade.go +++ b/store/sqlstore/upgrade.go @@ -323,6 +323,10 @@ func UpgradeDatabaseToVersion44(sqlStore SqlStore) { } func UpgradeDatabaseToVersion45(sqlStore SqlStore) { + //TODO: Remove next two lines before 4.5 release. They're just here to fix CI servers + sqlStore.AlterColumnTypeIfExists("PluginKeyValueStore", "PluginId", "varchar(50)", "varchar(50)") + sqlStore.AlterColumnTypeIfExists("PluginKeyValueStore", "PKey", "varchar(200)", "varchar(200)") + //TODO: Uncomment when 4.5 is released /*if shouldPerformUpgrade(sqlStore, VERSION_4_4_0, VERSION_4_5_0) { |