Skip to content

Commit

Permalink
enhance(prisma): Timestamps added for UserProposalSupervision and Use…
Browse files Browse the repository at this point in the history
…rProposalFeedback (#20)
  • Loading branch information
mxmlnwbr authored Dec 14, 2023
1 parent c297c5a commit ee99961
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ ALTER TABLE `userproposalfeedback` DROP COLUMN `createdAt`,

-- AlterTable
ALTER TABLE `userproposalsupervision` DROP COLUMN `createdAt`,
DROP COLUMN `updatedAt`;
DROP COLUMN `updatedAt`;
7 changes: 7 additions & 0 deletions prisma/migrations/20231214082817_add_timestamps/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- AlterTable
ALTER TABLE `userproposalfeedback` ADD COLUMN `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
ADD COLUMN `updatedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3);

-- AlterTable
ALTER TABLE `userproposalsupervision` ADD COLUMN `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
ADD COLUMN `updatedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3);
8 changes: 4 additions & 4 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ model UserProposalSupervision {
studentEmail String?
studyLevel String?
// createdAt DateTime @default(now())
// updatedAt DateTime @default(now()) @updatedAt
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}

model UserProposalFeedback {
Expand All @@ -206,8 +206,8 @@ model UserProposalFeedback {
reason String
comment String @db.Text
// createdAt DateTime @default(now())
// updatedAt DateTime @default(now()) @updatedAt
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
@@unique([proposalId, userEmail])
}
Binary file modified solutions/UZHBFThesisPlatform.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion solutions/UZHBFThesisPlatform/Other/Solution.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml version="9.2.23112.196" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImportExportXml version="9.2.23113.182" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SolutionManifest>
<UniqueName>UZHBFThesisPlatform</UniqueName>
<LocalizedNames>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@
"database": "default",
"table": "[main].[proposal]",
"id": "@triggerBody()?['proposalId']",
"item/createdAt": "@outputs('GetProposalInfo')?['body/createdAt']",
"item/title": "@outputs('GetProposalInfo')?['body/title']",
"item/description": "@outputs('GetProposalInfo')?['body/description']",
"item/language": "@outputs('GetProposalInfo')?['body/language']",
"item/statusKey": "MATCHED",
"item/studyLevel": "@outputs('GetProposalInfo')?['body/studyLevel']",
"item/title": "@outputs('GetProposalInfo')?['body/title']",
"item/topicAreaSlug": "@outputs('GetProposalInfo')?['body/topicAreaSlug']",
"item/typeKey": "@outputs('GetProposalInfo')?['body/typeKey']",
"item/updatedAt": "@outputs('GetProposalInfo')?['body/updatedAt']",
"item/ownedByStudent": "@outputs('GetProposalInfo')?['body/ownedByStudent']",
"item/statusKey": "MATCHED",
"item/createdAt": "@outputs('GetProposalInfo')?['body/createdAt']",
"item/updatedAt": "@utcNow()",
"item/timeFrame": "@outputs('GetProposalInfo')?['body/timeFrame']",
"item/ownedByUserEmail": "@outputs('GetProposalInfo')?['body/ownedByUserEmail']",
"item/timeFrame": "@outputs('GetProposalInfo')?['body/timeFrame']"
"item/ownedByStudent": "@outputs('GetProposalInfo')?['body/ownedByStudent']"
},
"authentication": "@parameters('$authentication')"
}
Expand Down Expand Up @@ -191,9 +191,11 @@
"table": "[main].[userproposalsupervision]",
"id": "@triggerBody()?['proposalId']",
"item/proposalId": "@outputs('GetUserProposalSupervisionInfo')?['body/proposalId']",
"item/createdAt": "@outputs('GetUserProposalSupervisionInfo')?['body/createdAt']",
"item/updatedAt": "@utcNow()",
"item/supervisorEmail": "@outputs('GetUserProposalSupervisionInfo')?['body/supervisorEmail']",
"item/studentEmail": "@triggerBody()?['applicantEmail']",
"item/studyLevel": "@outputs('GetUserProposalSupervisionInfo')?['body/studyLevel']",
"item/supervisorEmail": "@outputs('GetUserProposalSupervisionInfo')?['body/supervisorEmail']"
"item/studyLevel": "@outputs('GetUserProposalSupervisionInfo')?['body/studyLevel']"
},
"authentication": "@parameters('$authentication')"
}
Expand Down Expand Up @@ -244,15 +246,15 @@
"database": "default",
"table": "[main].[proposalapplication]",
"id": "@triggerBody()?['proposalApplicationId']",
"item/createdAt": "@outputs('GetProposalApplicationInfo')?['body/createdAt']",
"item/statusKey": "ACCEPTED",
"item/email": "@outputs('GetProposalApplicationInfo')?['body/email']",
"item/fullName": "@outputs('GetProposalApplicationInfo')?['body/fullName']",
"item/matriculationNumber": "@outputs('GetProposalApplicationInfo')?['body/matriculationNumber']",
"item/motivation": "@outputs('GetProposalApplicationInfo')?['body/motivation']",
"item/fullName": "@outputs('GetProposalApplicationInfo')?['body/fullName']",
"item/plannedStartAt": "@outputs('GetProposalApplicationInfo')?['body/plannedStartAt']",
"item/motivation": "@outputs('GetProposalApplicationInfo')?['body/motivation']",
"item/proposalId": "@outputs('GetProposalApplicationInfo')?['body/proposalId']",
"item/statusKey": "ACCEPTED",
"item/updatedAt": "@outputs('GetProposalApplicationInfo')?['body/updatedAt']",
"item/createdAt": "@outputs('GetProposalApplicationInfo')?['body/createdAt']",
"item/updatedAt": "@utcNow()",
"item/supervisionId": "@triggerBody()?['proposalId']"
},
"authentication": "@parameters('$authentication')"
Expand Down Expand Up @@ -303,15 +305,15 @@
"database": "default",
"table": "[main].[proposalapplication]",
"id": "@items('Apply_to_each')?['id']",
"item/createdAt": "@items('Apply_to_each')?['createdAt']",
"item/statusKey": "DECLINED",
"item/email": "@items('Apply_to_each')?['email']",
"item/fullName": "@items('Apply_to_each')?['fullName']",
"item/matriculationNumber": "@items('Apply_to_each')?['matriculationNumber']",
"item/motivation": "@items('Apply_to_each')?['motivation']",
"item/fullName": "@items('Apply_to_each')?['fullName']",
"item/plannedStartAt": "@items('Apply_to_each')?['plannedStartAt']",
"item/motivation": "@items('Apply_to_each')?['motivation']",
"item/proposalId": "@items('Apply_to_each')?['proposalId']",
"item/statusKey": "DECLINED",
"item/updatedAt": "@items('Apply_to_each')?['updatedAt']",
"item/createdAt": "@items('Apply_to_each')?['createdAt']",
"item/updatedAt": "@utcNow()",
"item/supervisionId": "@null"
},
"authentication": "@parameters('$authentication')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,15 @@
"server": "default",
"database": "default",
"table": "[main].[proposalapplication]",
"item/createdAt": "@utcNow()",
"item/email": "@triggerBody()?['uzhemail']",
"item/fullName": "@triggerBody()?['fullname']",
"item/id": "@guid()",
"item/statusKey": "OPEN",
"item/email": "@triggerBody()?['uzhemail']",
"item/matriculationNumber": "@triggerBody()?['matriculationnumber']",
"item/motivation": "@triggerBody()?['motivation']",
"item/fullName": "@triggerBody()?['fullname']",
"item/plannedStartAt": "@triggerBody()?['startingdate']",
"item/motivation": "@triggerBody()?['motivation']",
"item/proposalId": "@triggerBody()?['proposalid']",
"item/statusKey": "OPEN",
"item/createdAt": "@utcNow()",
"item/updatedAt": "@utcNow()"
},
"authentication": "@parameters('$authentication')"
Expand All @@ -434,13 +434,13 @@
"server": "default",
"database": "default",
"table": "[main].[applicationattachment]",
"item/createdAt": "@outputs('PersistApplication')?['body/createdAt']",
"item/href": "@outputs('CreateSharingLinkCv')?['body/link/webUrl']",
"item/id": "@guid()",
"item/name": "CV",
"item/proposalApplicationId": "@outputs('PersistApplication')?['body/id']",
"item/href": "@outputs('CreateSharingLinkCv')?['body/link/webUrl']",
"item/type": "application/pdf",
"item/updatedAt": "@outputs('PersistApplication')?['body/updatedAt']"
"item/proposalApplicationId": "@outputs('PersistApplication')?['body/id']",
"item/createdAt": "@utcNow()",
"item/updatedAt": "@utcNow()"
},
"authentication": "@parameters('$authentication')"
}
Expand All @@ -465,13 +465,13 @@
"server": "default",
"database": "default",
"table": "[main].[applicationattachment]",
"item/createdAt": "@outputs('PersistApplication')?['body/createdAt']",
"item/href": "@outputs('CreateSharingLinkTranscript')?['body/link/webUrl']",
"item/id": "@guid()",
"item/name": "Transcript",
"item/proposalApplicationId": "@outputs('PersistApplication')?['body/id']",
"item/href": "@outputs('CreateSharingLinkTranscript')?['body/link/webUrl']",
"item/type": "application/pdf",
"item/updatedAt": "@outputs('PersistApplication')?['body/updatedAt']"
"item/proposalApplicationId": "@outputs('PersistApplication')?['body/id']",
"item/createdAt": "@utcNow()",
"item/updatedAt": "@utcNow()"
},
"authentication": "@parameters('$authentication')"
}
Expand Down
Loading

0 comments on commit ee99961

Please sign in to comment.