Skip to content

Commit

Permalink
SAP make more fields optional for project
Browse files Browse the repository at this point in the history
  • Loading branch information
tkataja committed Mar 30, 2023
1 parent 12fdfd7 commit 83d12db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE sap_project
ALTER COLUMN project_manager_name DROP NOT NULL,
ALTER COLUMN applicant_name DROP NOT NULL;
4 changes: 2 additions & 2 deletions backend/src/components/sap/dataImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ async function insertProject(conn: DatabaseTransactionConnection, project: SAPPr
${project.createdBy},
${project.updatedAt ?? null},
${project.updatedBy ?? null},
${project.projectManagerName},
${project.applicantName},
${project.projectManagerName ?? null},
${project.applicantName ?? null},
${project.plannedStartDate ?? null},
${project.plannedEndDate ?? null},
${project.plant ?? null}
Expand Down
8 changes: 4 additions & 4 deletions shared/src/schema/sapProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const incomingSapProjectSchema = z.object({
ERNAM: z.string(),
AEDAT: isoDateString.nullish(),
AENAM: z.string().nullish(),
VERNA: z.string(),
ASTNA: z.string(),
VERNA: z.string().nullish(),
ASTNA: z.string().nullish(),
PLFAZ: isoDateString.nullish(),
PLSEZ: isoDateString.nullish(),
WERKS: z.string().nullish(),
Expand Down Expand Up @@ -148,8 +148,8 @@ export const sapProjectSchema = z.object({
createdBy: z.string(),
updatedAt: isoDateString.nullish(),
updatedBy: z.string().nullish(),
projectManagerName: z.string(),
applicantName: z.string(),
projectManagerName: z.string().nullish(),
applicantName: z.string().nullish(),
plannedStartDate: isoDateString.nullish(),
plannedEndDate: isoDateString.nullish(),
plant: z.string().nullish(),
Expand Down

0 comments on commit 83d12db

Please sign in to comment.