From a39b9de4232d6098183383dcefad7aaaeb9c8f3a Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 2 Apr 2024 10:48:35 +0700 Subject: [PATCH] feat: update database field --- prisma/schema.prisma | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index abd8bb9..dcc50ef 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -65,6 +65,11 @@ model SubDistrict { employee Employee[] } +enum Status { + CREATED + USED +} + model Branch { id String @id @default(uuid()) code String @@ -96,7 +101,7 @@ model Branch { headOffice Branch? @relation(name: "HeadOfficeRelation", fields: [headOfficeId], references: [id]) headOfficeId String? - status String? + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -109,10 +114,9 @@ model Branch { } model BranchContact { - id String @id @default(uuid()) - telephoneNo String - lineId String - qrCodeImageUrl String? + id String @id @default(uuid()) + telephoneNo String + lineId String branch Branch @relation(fields: [branchId], references: [id], onDelete: Cascade) branchId String @@ -141,6 +145,8 @@ model BranchUser { model User { id String @id @default(uuid()) + keycloakId String + code String firstNameTH String firstNameEN String @@ -169,8 +175,6 @@ model User { startDate DateTime retireDate DateTime - profileImageUrl String? - userType String userRole String @@ -185,7 +189,7 @@ model User { trainingPlace String - status String? + status Status @default(CREATED) createdBy String? createdAt DateTime @default(now()) @@ -368,11 +372,10 @@ 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 String? createdBy String? createdAt DateTime @default(now())