calcom/prisma/migrations/20211004231654_add_webhook_model/migration.sql
Omar López 30f97117e8
Revert "Revert "Feature/cal 274 add webhooks (#628)" (#854)" (#876)
This reverts commit 6868474c92.

Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
2021-10-07 15:14:47 +00:00

17 lines
511 B
SQL

-- CreateEnum
CREATE TYPE "WebhookTriggerEvents" AS ENUM ('BOOKING_CREATED', 'BOOKING_RESCHEDULED', 'BOOKING_CANCELLED');
-- CreateTable
CREATE TABLE "Webhook" (
"id" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
"subscriberUrl" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"active" BOOLEAN NOT NULL DEFAULT true,
"eventTriggers" "WebhookTriggerEvents"[],
PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Webhook.id_unique" ON "Webhook"("id");