refactor: change from required to not required

This commit is contained in:
Methapon2001 2024-04-04 16:08:22 +07:00
parent fff5558701
commit 57d2c575bc
3 changed files with 32 additions and 21 deletions

View file

@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "registrationNo" DROP NOT NULL,
ALTER COLUMN "startDate" DROP NOT NULL,
ALTER COLUMN "retireDate" DROP NOT NULL,
ALTER COLUMN "discountCondition" DROP NOT NULL,
ALTER COLUMN "licenseNo" DROP NOT NULL,
ALTER COLUMN "licenseIssueDate" DROP NOT NULL,
ALTER COLUMN "licenseExpireDate" DROP NOT NULL,
ALTER COLUMN "sourceNationality" DROP NOT NULL,
ALTER COLUMN "importNationality" DROP NOT NULL,
ALTER COLUMN "trainingPlace" DROP NOT NULL;

View file

@ -170,24 +170,24 @@ model User {
email String
telephoneNo String
registrationNo String
registrationNo String?
startDate DateTime
retireDate DateTime
startDate DateTime?
retireDate DateTime?
userType String
userRole String
discountCondition String
discountCondition String?
licenseNo String
licenseIssueDate DateTime
licenseExpireDate DateTime
licenseNo String?
licenseIssueDate DateTime?
licenseExpireDate DateTime?
sourceNationality String
importNationality String
sourceNationality String?
importNationality String?
trainingPlace String
trainingPlace String?
status Status @default(CREATED)

View file

@ -37,17 +37,17 @@ type UserCreate = {
lastName: string;
lastNameEN: string;
code: string;
registrationNo: string;
startDate: Date;
retireDate: Date;
discountCondition: string;
licenseNo: string;
licenseIssueDate: Date;
licenseExpireDate: Date;
sourceNationality: string;
importNationality: string;
trainingPlace: string;
code?: string;
registrationNo?: string;
startDate?: Date;
retireDate?: Date;
discountCondition?: string;
licenseNo?: string;
licenseIssueDate?: Date;
licenseExpireDate?: Date;
sourceNationality?: string;
importNationality?: string;
trainingPlace?: string;
address: string;
addressEN: string;