-- DropForeignKey
ALTER TABLE "PerkEvent" DROP CONSTRAINT "PerkEvent_userId_fkey";

-- DropForeignKey
ALTER TABLE "PerkInstance" DROP CONSTRAINT "PerkInstance_userId_fkey";

-- AlterTable
ALTER TABLE "PerkEvent" ALTER COLUMN "userId" DROP NOT NULL;

-- AlterTable
ALTER TABLE "PerkInstance" ALTER COLUMN "userId" DROP NOT NULL;

-- AddForeignKey
ALTER TABLE "PerkInstance" ADD CONSTRAINT "PerkInstance_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "PerkEvent" ADD CONSTRAINT "PerkEvent_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
