improvement: users can now comment on a case and it's details and have an option to make it visible for clinics too.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
-- Migrate legacy single-string labComment into per-case comment rows, then drop the column.
|
||||
|
||||
INSERT INTO "lab_case_comments" (
|
||||
"id",
|
||||
"labCaseId",
|
||||
"authorSide",
|
||||
"body",
|
||||
"visibleToClinic",
|
||||
"createdAt",
|
||||
"updatedAt"
|
||||
)
|
||||
SELECT
|
||||
gen_random_uuid()::text,
|
||||
lc."id",
|
||||
'CLINIC'::"LabCaseCommentSide",
|
||||
trim(lc."labComment"),
|
||||
true,
|
||||
COALESCE(lc."sentAt", NOW()),
|
||||
NOW()
|
||||
FROM "lab_cases" lc
|
||||
WHERE lc."labComment" IS NOT NULL AND trim(lc."labComment") <> '';
|
||||
|
||||
ALTER TABLE "lab_cases" DROP COLUMN "labComment";
|
||||
@@ -193,7 +193,6 @@ model LabCase {
|
||||
clientKey String?
|
||||
sortOrder Int
|
||||
destinationOrganizationId String?
|
||||
labComment String?
|
||||
sentAt DateTime?
|
||||
|
||||
treatment Treatment @relation(fields: [treatmentId], references: [id], onDelete: Cascade)
|
||||
|
||||
Reference in New Issue
Block a user