From c3f8673ac852b984b970c49b46747534e720e6d5 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:02:31 +0700 Subject: [PATCH] fix: wrong field --- .../20240607070114_fix_wrong_field/migration.sql | 10 ++++++++++ prisma/schema.prisma | 2 +- src/controllers/customer-branch-controller.ts | 4 ++-- src/controllers/customer-controller.ts | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 prisma/migrations/20240607070114_fix_wrong_field/migration.sql diff --git a/prisma/migrations/20240607070114_fix_wrong_field/migration.sql b/prisma/migrations/20240607070114_fix_wrong_field/migration.sql new file mode 100644 index 0000000..a5494e8 --- /dev/null +++ b/prisma/migrations/20240607070114_fix_wrong_field/migration.sql @@ -0,0 +1,10 @@ +/* + Warnings: + + - You are about to drop the column `wageDate` on the `CustomerBranch` table. All the data in the column will be lost. + - Added the required column `wageRate` to the `CustomerBranch` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "CustomerBranch" DROP COLUMN "wageDate", +ADD COLUMN "wageRate" INTEGER NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index d00c514..a8d0dd9 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -388,7 +388,7 @@ model CustomerBranch { jobDescription String saleEmployee String payDate DateTime - wageDate DateTime + wageRate Int status Status @default(CREATED) diff --git a/src/controllers/customer-branch-controller.ts b/src/controllers/customer-branch-controller.ts index d9feddc..032ee8f 100644 --- a/src/controllers/customer-branch-controller.ts +++ b/src/controllers/customer-branch-controller.ts @@ -61,7 +61,7 @@ export type CustomerBranchCreate = { jobDescription: string; saleEmployee: string; payDate: Date; - wageDate: Date; + wageRate: number; subDistrictId?: string | null; districtId?: string | null; @@ -96,7 +96,7 @@ export type CustomerBranchUpdate = { jobDescription?: string; saleEmployee?: string; payDate?: Date; - wageDate?: Date; + wageDate?: number; subDistrictId?: string | null; districtId?: string | null; diff --git a/src/controllers/customer-controller.ts b/src/controllers/customer-controller.ts index d227583..9319525 100644 --- a/src/controllers/customer-controller.ts +++ b/src/controllers/customer-controller.ts @@ -57,7 +57,7 @@ export type CustomerCreate = { jobDescription: string; saleEmployee: string; payDate: Date; - wageDate: Date; + wageRate: number; subDistrictId?: string | null; districtId?: string | null; @@ -99,7 +99,7 @@ export type CustomerUpdate = { jobDescription: string; saleEmployee: string; payDate: Date; - wageDate: Date; + wageRate: number; subDistrictId?: string | null; districtId?: string | null;