-- CreateEnum
CREATE TYPE "UserTaskStatus" AS ENUM ('Pending', 'Accept', 'Submit');

-- CreateTable
CREATE TABLE "UserTask" (
    "id" TEXT NOT NULL,
    "userTaskStatus" "UserTaskStatus" NOT NULL,
    "taskOrderId" TEXT NOT NULL,
    "userId" TEXT NOT NULL,

    CONSTRAINT "UserTask_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "UserTask" ADD CONSTRAINT "UserTask_taskOrderId_fkey" FOREIGN KEY ("taskOrderId") REFERENCES "TaskOrder"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "UserTask" ADD CONSTRAINT "UserTask_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
