fix: queries for webhooks + improve tests

This commit is contained in:
Lakhan Samani
2023-03-29 07:06:33 +05:30
parent a38e9d4e6c
commit e822b6f31a
45 changed files with 213 additions and 138 deletions

View File

@@ -207,6 +207,13 @@ func NewProvider() (*provider, error) {
if err != nil {
return nil, err
}
// add event_description to webhook table
webhookAlterQuery := fmt.Sprintf(`ALTER TABLE %s.%s ADD (event_description text);`, KeySpace, models.Collections.Webhook)
err = session.Query(webhookAlterQuery).Exec()
if err != nil {
log.Debug("Failed to alter table as column exists: ", err)
// continue
}
webhookLogCollectionQuery := fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s.%s (id text, http_status bigint, response text, request text, webhook_id text,updated_at bigint, created_at bigint, PRIMARY KEY (id))", KeySpace, models.Collections.WebhookLog)
err = session.Query(webhookLogCollectionQuery).Exec()