18 lines
511 B
SQL
18 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");
|