refactor: add work status and process user

This commit is contained in:
Methapon Metanipat 2024-10-10 13:21:11 +07:00
parent a06be541a8
commit 7413b2a8f8
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,9 @@
-- CreateEnum
CREATE TYPE "RequestWorkStatus" AS ENUM ('Pending', 'InProgress', 'Completed');
-- AlterTable
ALTER TABLE "RequestWork" ADD COLUMN "processByUserId" TEXT,
ADD COLUMN "workStatus" "RequestWorkStatus" NOT NULL DEFAULT 'Pending';
-- AddForeignKey
ALTER TABLE "RequestWork" ADD CONSTRAINT "RequestWork_processByUserId_fkey" FOREIGN KEY ("processByUserId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;