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;