mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add webhooks model
This commit is contained in:
parent
9a9fb94cf4
commit
fe09487a6a
2 changed files with 30 additions and 0 deletions
21
packages/db/migrations/0083.do.webhooks.sql
Executable file
21
packages/db/migrations/0083.do.webhooks.sql
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
-- Type: DO
|
||||
-- Name: webhooks
|
||||
-- Description: webhooks model
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE omnivore.webhooks (
|
||||
id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
|
||||
url text NOT NULL,
|
||||
method text NOT NULL DEFAULT 'POST',
|
||||
content_type text NOT NULL DEFAULT 'application/json',
|
||||
active boolean NOT NULL DEFAULT true,
|
||||
event_types text[] NOT NULL,
|
||||
created_at timestamptz NOT NULL DEFAULT current_timestamp,
|
||||
updated_at timestamptz NOT NULL DEFAULT current_timestamp
|
||||
);
|
||||
|
||||
CREATE TRIGGER update_webhook_modtime BEFORE UPDATE ON omnivore.webhooks
|
||||
FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column();
|
||||
|
||||
COMMIT;
|
||||
9
packages/db/migrations/0083.undo.webhooks.sql
Executable file
9
packages/db/migrations/0083.undo.webhooks.sql
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
-- Type: UNDO
|
||||
-- Name: webhooks
|
||||
-- Description: webhooks model
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP TABLE IF EXISTS omnivore.webhooks;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue