Enable Task creation (#688)
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "ActivityType" AS ENUM ('Note', 'Task');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "comment_threads" ADD COLUMN "assigneeId" TEXT,
|
||||
ADD COLUMN "completedAt" TIMESTAMP(3),
|
||||
ADD COLUMN "dueAt" TIMESTAMP(3),
|
||||
ADD COLUMN "reminderAt" TIMESTAMP(3),
|
||||
ADD COLUMN "type" "ActivityType" NOT NULL DEFAULT 'Note';
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "comment_threads" ADD CONSTRAINT "comment_threads_assigneeId_fkey" FOREIGN KEY ("assigneeId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@ -175,9 +175,10 @@ model User {
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
deletedAt DateTime?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
CommentThread CommentThread[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
authoredCommentThreads CommentThread[] @relation(name: "authoredCommentThreads")
|
||||
assignedCommentThreads CommentThread[] @relation(name: "assignedCommentThreads")
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
@ -324,6 +325,11 @@ model RefreshToken {
|
||||
@@map("refresh_tokens")
|
||||
}
|
||||
|
||||
enum ActivityType {
|
||||
Note
|
||||
Task
|
||||
}
|
||||
|
||||
model CommentThread {
|
||||
/// @Validator.IsString()
|
||||
/// @Validator.IsOptional()
|
||||
@ -337,10 +343,17 @@ model CommentThread {
|
||||
workspaceId String
|
||||
|
||||
authorId String
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
author User @relation(fields: [authorId], references: [id], name: "authoredCommentThreads")
|
||||
|
||||
body String?
|
||||
title String?
|
||||
type ActivityType @default(Note)
|
||||
|
||||
reminderAt DateTime?
|
||||
dueAt DateTime?
|
||||
completedAt DateTime?
|
||||
assignee User? @relation(fields: [assigneeId], references: [id], name: "assignedCommentThreads")
|
||||
assigneeId String?
|
||||
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
deletedAt DateTime?
|
||||
|
||||
@ -7,6 +7,7 @@ export const seedComments = async (prisma: PrismaClient) => {
|
||||
id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfb400',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
title: 'Performance update',
|
||||
type: 'Note',
|
||||
body: '[{"id":"555df0c3-ab88-4c62-abae-c9b557c37c5b","type":"paragraph","props":{"textColor":"default","backgroundColor":"default","textAlignment":"left"},"content":[{"type":"text","text":"In the North American region, we have observed a strong growth rate of 18% in sales. Europe followed suit with a significant 14% increase, while Asia-Pacific sustained its performance with a steady 10% rise. Special kudos to the North American team for the excellent work done in penetrating new markets and establishing stronger footholds in the existing ones.","styles":{}}],"children":[]},{"id":"13530934-b3ce-4332-9238-3760aa4acb3e","type":"paragraph","props":{"textColor":"default","backgroundColor":"default","textAlignment":"left"},"content":[],"children":[]}]',
|
||||
authorId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408',
|
||||
},
|
||||
@ -54,6 +55,9 @@ export const seedComments = async (prisma: PrismaClient) => {
|
||||
id: 'twenty-fe256b39-3ec3-4fe3-8997-b76aa0bfc408',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
title: 'Buyout Proposal',
|
||||
type: 'Task',
|
||||
assigneeId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408',
|
||||
dueAt: new Date('2021-03-01T00:00:00.000Z'),
|
||||
body: '[{"id":"333df0c3-ab88-4c62-abae-c9b557c37c5b","type":"paragraph","props":{"textColor":"default","backgroundColor":"default","textAlignment":"left"},"content":[{"type":"text","text":"We are considering the potential acquisition of [Company], a leading company in [Industry/Specific Technology]. This company has demonstrated remarkable success and pioneering advancements in their field, paralleling our own commitment to progress. By integrating their expertise with our own, we believe that we can amplify our growth, broaden our offerings, and fortify our position at the forefront of technology. This prospective partnership could help to ensure our continued leadership in the industry and allow us to deliver even more innovative solutions for our customers.","styles":{}}],"children":[]},{"id":"13530934-b3ce-4332-9238-3760aa4acb3e","type":"paragraph","props":{"textColor":"default","backgroundColor":"default","textAlignment":"left"},"content":[],"children":[]}]',
|
||||
authorId: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user