chore: migrations

This commit is contained in:
Methapon Metanipat 2024-11-15 10:51:40 +07:00
parent 1e493930a9
commit d67303d5cc

View file

@ -0,0 +1,23 @@
/*
Warnings:
- Added the required column `code` to the `RequestData` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `RequestData` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "RequestWork" DROP CONSTRAINT "RequestWork_productServiceId_fkey";
-- DropForeignKey
ALTER TABLE "RequestWork" DROP CONSTRAINT "RequestWork_requestDataId_fkey";
-- AlterTable
ALTER TABLE "RequestData" ADD COLUMN "code" TEXT NOT NULL,
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL;
-- AddForeignKey
ALTER TABLE "RequestWork" ADD CONSTRAINT "RequestWork_requestDataId_fkey" FOREIGN KEY ("requestDataId") REFERENCES "RequestData"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "RequestWork" ADD CONSTRAINT "RequestWork_productServiceId_fkey" FOREIGN KEY ("productServiceId") REFERENCES "QuotationProductServiceList"("id") ON DELETE CASCADE ON UPDATE CASCADE;