chore: migration

This commit is contained in:
Methapon Metanipat 2024-11-19 13:49:12 +07:00
parent fcb2e97b45
commit 371514c5f6

View file

@ -0,0 +1,20 @@
/*
Warnings:
- You are about to drop the column `workStatus` on the `RequestWork` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "RequestWork" DROP COLUMN "workStatus";
-- CreateTable
CREATE TABLE "RequestWorkStepStatus" (
"step" INTEGER NOT NULL,
"workStatus" "RequestWorkStatus" NOT NULL DEFAULT 'Pending',
"requestWorkId" TEXT NOT NULL,
CONSTRAINT "RequestWorkStepStatus_pkey" PRIMARY KEY ("step","requestWorkId")
);
-- AddForeignKey
ALTER TABLE "RequestWorkStepStatus" ADD CONSTRAINT "RequestWorkStepStatus_requestWorkId_fkey" FOREIGN KEY ("requestWorkId") REFERENCES "RequestWork"("id") ON DELETE RESTRICT ON UPDATE CASCADE;