From 59453dd417d658c730a65a1676bea978d9168cfd Mon Sep 17 00:00:00 2001 From: Navaneethakrishnan Date: Thu, 5 Sep 2024 13:57:50 +0530 Subject: [PATCH] feat: introduced teamName, eventName, projectName in discovered question --- .../migration.sql | 4 ++++ apps/web-api/prisma/schema.prisma | 3 +++ libs/contracts/src/schema/discovery-question.ts | 6 ++++++ 3 files changed, 13 insertions(+) create mode 100644 apps/web-api/prisma/migrations/20240905081856_discover_question_updated_fields/migration.sql diff --git a/apps/web-api/prisma/migrations/20240905081856_discover_question_updated_fields/migration.sql b/apps/web-api/prisma/migrations/20240905081856_discover_question_updated_fields/migration.sql new file mode 100644 index 000000000..3da119f1d --- /dev/null +++ b/apps/web-api/prisma/migrations/20240905081856_discover_question_updated_fields/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable +ALTER TABLE "DiscoveryQuestion" ADD COLUMN "eventName" TEXT, +ADD COLUMN "projectName" TEXT, +ADD COLUMN "teamName" TEXT; diff --git a/apps/web-api/prisma/schema.prisma b/apps/web-api/prisma/schema.prisma index c152df08e..36412bb0d 100644 --- a/apps/web-api/prisma/schema.prisma +++ b/apps/web-api/prisma/schema.prisma @@ -517,10 +517,13 @@ model DiscoveryQuestion { isActive Boolean @default(true) teamUid String? team Team? @relation("TeamRelatedDiscoveryQuestions", fields: [teamUid], references: [uid]) + teamName String? projectUid String? project Project? @relation("ProjectRelatedDiscoveryQuestions", fields: [projectUid], references: [uid]) + projectName String? eventUid String? plevent PLEvent? @relation("PLEventRelatedDiscoveryQuestions", fields: [eventUid], references: [uid]) + eventName String? createdBy String creator Member? @relation("MemberCreatedDiscoveryQuestions", fields: [createdBy], references: [uid]) modifiedBy String diff --git a/libs/contracts/src/schema/discovery-question.ts b/libs/contracts/src/schema/discovery-question.ts index 22da0bd60..e334364e4 100644 --- a/libs/contracts/src/schema/discovery-question.ts +++ b/libs/contracts/src/schema/discovery-question.ts @@ -14,8 +14,11 @@ export const DiscoveryQuestionSchema = z.object({ shareCount: z.number().int(), isActive: z.boolean().default(true), teamUid: z.string().nullish(), + teamName: z.string().nullish(), eventUid: z.string().nullish(), + eventName: z.string().nullish(), projectUid: z.string().nullish(), + projectName: z.string().nullish(), answer: z.string().optional(), answerSources: z.any().optional(), relatedQuestions: z.any().optional(), @@ -31,8 +34,11 @@ export const CreateDiscoveryQuestionSchema = DiscoveryQuestionSchema.pick({ shareCount: true, isActive: true, teamUid: true, + teamName: true, eventUid: true, + eventName: true, projectUid: true, + projectName: true, answer: true, relatedQuestions: true, answerSources: true,