diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-06-09 21:57:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-09 21:57:36 +0200 |
commit | a2871cd74719a7a5a104daaa3dcc0e2670b7c2df (patch) | |
tree | cfd30fe202cd5be1c2984f4031d825d950784da2 /db | |
parent | 17ba5e1e616c853a389b9c24a347d873747f2126 (diff) |
Add administrative webhooks (#18510)
* Add administrative webhooks * Fix error when webhook is deleted before delivery worker runs
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20220606044941_create_webhooks.rb | 12 | ||||
-rw-r--r-- | db/schema.rb | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/db/migrate/20220606044941_create_webhooks.rb b/db/migrate/20220606044941_create_webhooks.rb new file mode 100644 index 000000000..cca48fce6 --- /dev/null +++ b/db/migrate/20220606044941_create_webhooks.rb @@ -0,0 +1,12 @@ +class CreateWebhooks < ActiveRecord::Migration[6.1] + def change + create_table :webhooks do |t| + t.string :url, null: false, index: { unique: true } + t.string :events, array: true, null: false, default: [] + t.string :secret, null: false, default: '' + t.boolean :enabled, null: false, default: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 081955660..5d8aea601 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_05_27_114923) do +ActiveRecord::Schema.define(version: 2022_06_06_044941) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1035,6 +1035,16 @@ ActiveRecord::Schema.define(version: 2022_05_27_114923) do t.index ["user_id"], name: "index_webauthn_credentials_on_user_id" end + create_table "webhooks", force: :cascade do |t| + t.string "url", null: false + t.string "events", default: [], null: false, array: true + t.string "secret", default: "", null: false + t.boolean "enabled", default: true, null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["url"], name: "index_webhooks_on_url", unique: true + end + add_foreign_key "account_aliases", "accounts", on_delete: :cascade add_foreign_key "account_conversations", "accounts", on_delete: :cascade add_foreign_key "account_conversations", "conversations", on_delete: :cascade |