From d67303d5cca54615c753ff664828e8f495f5966c Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Fri, 15 Nov 2024 10:51:40 +0700 Subject: [PATCH] chore: migrations --- .../migration.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 prisma/migrations/20241115035109_update_structure/migration.sql diff --git a/prisma/migrations/20241115035109_update_structure/migration.sql b/prisma/migrations/20241115035109_update_structure/migration.sql new file mode 100644 index 0000000..a1ae129 --- /dev/null +++ b/prisma/migrations/20241115035109_update_structure/migration.sql @@ -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;