summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-03-30 10:56:20 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-04-04 09:45:02 -0400
commit441156b91e9f9bac6b5592616551e2920c4cb33b (patch)
tree64e0c2e8a1329a0b761883fd47c3b588d11a69af /store
parent785553384fe96027b0e9274b6ccc8623092eda70 (diff)
downloadchat-441156b91e9f9bac6b5592616551e2920c4cb33b.tar.gz
chat-441156b91e9f9bac6b5592616551e2920c4cb33b.tar.bz2
chat-441156b91e9f9bac6b5592616551e2920c4cb33b.zip
Added DisplayName and Description fields to both types of webhooks and slash commands
Diffstat (limited to 'store')
-rw-r--r--store/sql_command_store.go2
-rw-r--r--store/sql_webhook_store.go9
2 files changed, 11 insertions, 0 deletions
diff --git a/store/sql_command_store.go b/store/sql_command_store.go
index 074a6e588..02b3a0cc5 100644
--- a/store/sql_command_store.go
+++ b/store/sql_command_store.go
@@ -28,12 +28,14 @@ func NewSqlCommandStore(sqlStore *SqlStore) CommandStore {
tableo.ColMap("AutoCompleteDesc").SetMaxSize(1024)
tableo.ColMap("AutoCompleteHint").SetMaxSize(1024)
tableo.ColMap("DisplayName").SetMaxSize(64)
+ tableo.ColMap("Description").SetMaxSize(128)
}
return s
}
func (s SqlCommandStore) UpgradeSchemaIfNeeded() {
+ s.CreateColumnIfNotExists("Commands", "Description", "varchar(128)", "varchar(128)", "")
}
func (s SqlCommandStore) CreateIndexesIfNotExists() {
diff --git a/store/sql_webhook_store.go b/store/sql_webhook_store.go
index 740c9a33f..3c1f404e1 100644
--- a/store/sql_webhook_store.go
+++ b/store/sql_webhook_store.go
@@ -20,6 +20,8 @@ func NewSqlWebhookStore(sqlStore *SqlStore) WebhookStore {
table.ColMap("UserId").SetMaxSize(26)
table.ColMap("ChannelId").SetMaxSize(26)
table.ColMap("TeamId").SetMaxSize(26)
+ table.ColMap("DisplayName").SetMaxSize(64)
+ table.ColMap("Description").SetMaxSize(128)
tableo := db.AddTableWithName(model.OutgoingWebhook{}, "OutgoingWebhooks").SetKeys(false, "Id")
tableo.ColMap("Id").SetMaxSize(26)
@@ -29,12 +31,19 @@ func NewSqlWebhookStore(sqlStore *SqlStore) WebhookStore {
tableo.ColMap("TeamId").SetMaxSize(26)
tableo.ColMap("TriggerWords").SetMaxSize(1024)
tableo.ColMap("CallbackURLs").SetMaxSize(1024)
+ tableo.ColMap("DisplayName").SetMaxSize(64)
+ tableo.ColMap("Description").SetMaxSize(128)
}
return s
}
func (s SqlWebhookStore) UpgradeSchemaIfNeeded() {
+ s.CreateColumnIfNotExists("IncomingWebhooks", "DisplayName", "varchar(64)", "varchar(64)", "")
+ s.CreateColumnIfNotExists("IncomingWebhooks", "Description", "varchar(128)", "varchar(128)", "")
+
+ s.CreateColumnIfNotExists("OutgoingWebhooks", "DisplayName", "varchar(64)", "varchar(64)", "")
+ s.CreateColumnIfNotExists("OutgoingWebhooks", "Description", "varchar(128)", "varchar(128)", "")
}
func (s SqlWebhookStore) CreateIndexesIfNotExists() {