feat: Add event subscription option to webhooks (#4540)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
12
db/migrate/20220424081117_add_subscriptions_to_webhooks.rb
Normal file
12
db/migrate/20220424081117_add_subscriptions_to_webhooks.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class AddSubscriptionsToWebhooks < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :webhooks, :subscriptions, :jsonb, default: %w[
|
||||
conversation_status_changed
|
||||
conversation_updated
|
||||
conversation_created
|
||||
message_created
|
||||
message_updated
|
||||
webwidget_triggered
|
||||
]
|
||||
end
|
||||
end
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_04_18_094715) do
|
||||
ActiveRecord::Schema.define(version: 2022_04_24_081117) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
@@ -763,6 +763,7 @@ ActiveRecord::Schema.define(version: 2022_04_18_094715) do
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.integer "webhook_type", default: 0
|
||||
t.jsonb "subscriptions", default: ["conversation_status_changed", "conversation_updated", "conversation_created", "message_created", "message_updated", "webwidget_triggered"]
|
||||
t.index ["account_id", "url"], name: "index_webhooks_on_account_id_and_url", unique: true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user