// This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { provider = "prisma-client-js" } datasource db { provider = "sqlite" url = env("DATABASE_URL") } model Task { id String @id @default(cuid()) title String description String? status String @default("todo") priority String @default("medium") source String // "reminders" | "jira" sourceId String? // ID dans le système source tagsJson String @default("[]") // JSON string des tags pour compatibilité dueDate DateTime? completedAt DateTime? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt // Métadonnées Jira jiraProject String? jiraKey String? assignee String? // Relations taskTags TaskTag[] @@unique([source, sourceId]) @@map("tasks") } model Tag { id String @id @default(cuid()) name String @unique color String @default("#6b7280") taskTags TaskTag[] @@map("tags") } model TaskTag { taskId String tagId String task Task @relation(fields: [taskId], references: [id], onDelete: Cascade) tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade) @@id([taskId, tagId]) @@map("task_tags") } model SyncLog { id String @id @default(cuid()) source String // "reminders" | "jira" status String // "success" | "error" message String? tasksSync Int @default(0) createdAt DateTime @default(now()) @@map("sync_logs") }