- Add reminders to Prisma schema (Reminder model, TaskReminder relation) - Add /api/reminders endpoint and cron send-reminders.ts script - Add reminder fields to NewTaskModal and EditTaskModal components - Fix reminder datetime serialization: use toISOString().slice(0,16) for UTC-safe YYYY-MM-DDTHH:mm format compatible with datetime-local inputs - Update Dockerfile to install tsx for cron container - Add AGENTS.md with project conventions - Update docker-compose.yml with cron service and build context
103 lines
2.9 KiB
Plaintext
103 lines
2.9 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client"
|
|
output = "../src/generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Project {
|
|
id String @id @default(uuid()) @db.Uuid
|
|
name String
|
|
description String @default("")
|
|
color String @default("#3b82f6")
|
|
sortOrder Int @default(0) @map("sort_order")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
tasks Task[]
|
|
|
|
@@index([sortOrder])
|
|
}
|
|
|
|
model Task {
|
|
id String @id @default(uuid()) @db.Uuid
|
|
title String
|
|
description String @default("")
|
|
completed Boolean @default(false)
|
|
priority Priority @default(medium)
|
|
dueDate DateTime? @map("due_date")
|
|
status Status @default(todo)
|
|
parentTaskId String? @map("parent_task_id") @db.Uuid
|
|
recurrenceRule Recurrence @default(none) @map("recurrence_rule")
|
|
recurrenceInterval Int @default(1) @map("recurrence_interval")
|
|
nextOccurrence DateTime? @map("next_occurrence")
|
|
sortOrder Int @default(0) @map("sort_order")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
parentTask Task? @relation("TaskChildren", fields: [parentTaskId], references: [id], onDelete: Cascade)
|
|
children Task[] @relation("TaskChildren")
|
|
project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
|
projectId String? @map("project_id") @db.Uuid
|
|
reminders TaskReminder[] @relation("TaskReminders")
|
|
|
|
@@index([projectId])
|
|
@@index([parentTaskId])
|
|
@@index([completed])
|
|
@@index([status])
|
|
@@index([dueDate])
|
|
@@index([recurrenceRule])
|
|
}
|
|
|
|
enum Priority {
|
|
low
|
|
medium
|
|
high
|
|
urgent
|
|
}
|
|
|
|
enum Status {
|
|
todo
|
|
in_progress
|
|
done
|
|
}
|
|
|
|
enum Recurrence {
|
|
none
|
|
daily
|
|
weekly
|
|
biweekly
|
|
monthly
|
|
yearly
|
|
}
|
|
|
|
model TaskReminder {
|
|
id String @id @default(uuid()) @db.Uuid
|
|
taskId String @map("task_id") @db.Uuid
|
|
reminder DateTime @map("reminder")
|
|
sent Boolean @default(false) @map("sent")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
|
|
task Task @relation("TaskReminders", fields: [taskId], references: [id], onDelete: Cascade)
|
|
|
|
@@index([taskId])
|
|
@@index([sent])
|
|
}
|
|
|
|
model Reminder {
|
|
id String @id @default(uuid()) @db.Uuid
|
|
message String
|
|
dueDate DateTime @map("due_date")
|
|
sent Boolean @default(false) @map("sent")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@index([dueDate])
|
|
@@index([sent])
|
|
}
|