Add activity detail, Jalali pickers, and customer/user profiles.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "ActivityPriority" AS ENUM ('low', 'medium', 'high');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Activity" ADD COLUMN "priority" "ActivityPriority" NOT NULL DEFAULT 'medium';
|
||||
ALTER TABLE "Activity" ADD COLUMN "createdById" TEXT;
|
||||
|
||||
UPDATE "Activity" SET "createdById" = "assigneeId" WHERE "createdById" IS NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Activity" ADD CONSTRAINT "Activity_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Activity_organizationId_createdById_idx" ON "Activity"("organizationId", "createdById");
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
-- AlterEnum
|
||||
ALTER TYPE "ActivityPriority" ADD VALUE 'very_low';
|
||||
ALTER TYPE "ActivityPriority" ADD VALUE 'very_high';
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Activity" ADD COLUMN "durationMinutes" INTEGER;
|
||||
ALTER TABLE "Activity" ADD COLUMN "reminderAt" TIMESTAMP(3);
|
||||
@@ -33,6 +33,14 @@ enum ActivityStatus {
|
||||
canceled
|
||||
}
|
||||
|
||||
enum ActivityPriority {
|
||||
low
|
||||
medium
|
||||
high
|
||||
very_low
|
||||
very_high
|
||||
}
|
||||
|
||||
enum CustomFieldEntity {
|
||||
person
|
||||
company
|
||||
@@ -165,6 +173,7 @@ model User {
|
||||
ownedCompanies Company[] @relation("CompanyOwner")
|
||||
ownedProjectCards ProjectCard[] @relation("ProjectCardOwner")
|
||||
activities Activity[] @relation("ActivityAssignee")
|
||||
createdActivities Activity[] @relation("ActivityCreator")
|
||||
notes Note[] @relation("NoteAuthor")
|
||||
noteAttachments NoteAttachment[] @relation("NoteAttachmentUploader")
|
||||
notifications Notification[]
|
||||
@@ -333,10 +342,13 @@ model Activity {
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
type ActivityType @default(task)
|
||||
status ActivityStatus @default(open)
|
||||
title String
|
||||
description String?
|
||||
dueAt DateTime?
|
||||
completedAt DateTime?
|
||||
priority ActivityPriority @default(medium)
|
||||
title String
|
||||
description String?
|
||||
dueAt DateTime?
|
||||
durationMinutes Int?
|
||||
reminderAt DateTime?
|
||||
completedAt DateTime?
|
||||
personId String?
|
||||
person Person? @relation(fields: [personId], references: [id], onDelete: SetNull)
|
||||
companyId String?
|
||||
@@ -345,11 +357,14 @@ model Activity {
|
||||
deal Deal? @relation(fields: [dealId], references: [id], onDelete: SetNull)
|
||||
assigneeId String?
|
||||
assignee User? @relation("ActivityAssignee", fields: [assigneeId], references: [id], onDelete: SetNull)
|
||||
createdById String?
|
||||
createdBy User? @relation("ActivityCreator", fields: [createdById], references: [id], onDelete: SetNull)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([organizationId, status, dueAt])
|
||||
@@index([organizationId, assigneeId])
|
||||
@@index([organizationId, createdById])
|
||||
@@index([personId])
|
||||
@@index([companyId])
|
||||
@@index([dealId])
|
||||
|
||||
Reference in New Issue
Block a user