cal.pub0.org/packages/prisma/migrations/20230216134219_managed_events/migration.sql

18 lines
597 B
SQL

/*
Warnings:
- A unique constraint covering the columns `[userId,parentId]` on the table `EventType` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterEnum
ALTER TYPE "SchedulingType" ADD VALUE 'managed';
-- AlterTable
ALTER TABLE "EventType" ADD COLUMN "parentId" INTEGER;
-- CreateIndex
CREATE UNIQUE INDEX "EventType_userId_parentId_key" ON "EventType"("userId", "parentId");
-- AddForeignKey
ALTER TABLE "EventType" ADD CONSTRAINT "EventType_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "EventType"("id") ON DELETE CASCADE ON UPDATE CASCADE;