mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
20 lines
682 B
SQL
20 lines
682 B
SQL
-- CreateEnum
|
|
CREATE TYPE "WebhookTriggerEvents" AS ENUM ('DOCUMENT_CREATED', 'DOCUMENT_SIGNED');
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "Webhook" (
|
|
"id" SERIAL NOT NULL,
|
|
"webhookUrl" TEXT NOT NULL,
|
|
"eventTriggers" "WebhookTriggerEvents"[],
|
|
"secret" TEXT,
|
|
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"userId" INTEGER NOT NULL,
|
|
|
|
CONSTRAINT "Webhook_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "Webhook" ADD CONSTRAINT "Webhook_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|