diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-12-05 18:19:33 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-12-05 15:19:33 -0800 |
commit | 7cefef6d21fa76de0683d2fe9ff56a6e28816628 (patch) | |
tree | 3aff5d34a44bb65cfefa5e69084d2bd484d1dd51 /store | |
parent | 150de584c348d6317199fd619f0c144464b8f755 (diff) | |
download | chat-7cefef6d21fa76de0683d2fe9ff56a6e28816628.tar.gz chat-7cefef6d21fa76de0683d2fe9ff56a6e28816628.tar.bz2 chat-7cefef6d21fa76de0683d2fe9ff56a6e28816628.zip |
Hash key for plugin store and limit id length (#7933)
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..23b355f48 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(190) + table.ColMap("Key").SetMaxSize(50) table.ColMap("Value").SetMaxSize(8192) } diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go index d10235135..932330a21 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", "PKey", "varchar(50)", "varchar(50)") + sqlStore.AlterColumnTypeIfExists("PluginKeyValueStore", "PluginId", "varchar(190)", "varchar(190)") + //TODO: Uncomment when 4.5 is released /*if shouldPerformUpgrade(sqlStore, VERSION_4_4_0, VERSION_4_5_0) { |