From 9f95bbd7456bfeea1b0d8fec4425bc973c297270 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:54:11 +0700 Subject: [PATCH] feat: change database field to enum with default --- prisma/schema.prisma | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index abd8bb9..5b72ed7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -203,7 +203,7 @@ model Customer { customerNameEN String imageUrl String? - status String? + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -290,7 +290,7 @@ model Employee { customerBranch CustomerBranch? @relation(fields: [customerBranchId], references: [id], onDelete: SetNull) customerBranchId String? - status String? + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -368,11 +368,11 @@ model EmployeeOtherInfo { model Service { id String @id @default(uuid()) - code String - name String - detail String - imageUrl String - status String? + code String + name String + detail String + + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -384,12 +384,14 @@ model Service { model Work { id String @id @default(uuid()) - order String + order Int name String service Service @relation(fields: [serviceId], references: [id], onDelete: Cascade) serviceId String + status Status @default(CREATED) + createdBy String? createdAt DateTime @default(now()) updateBy String? @@ -416,7 +418,8 @@ model ProductGroup { name String detail String remark String - status String? + + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -432,7 +435,8 @@ model ProductType { name String detail String remark String - status String? + + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -453,7 +457,8 @@ model Product { agentPrice Int serviceCharge Int imageUrl String - status String? + + status Status @default(CREATED) productType ProductType? @relation(fields: [productTypeId], references: [id], onDelete: SetNull) productTypeId String?