generator client { provider = "prisma-client-js" //output = "../src/generated/prisma" } datasource db { provider = "postgresql" } model User { id Int @id @default(autoincrement()) firstName String @map("first_name") lastName String? @map("last_name") email String @unique encryptedPassword String @map("encrypted_password") passwordResetToken String? @map("password_reset_token") passwordResetExpires DateTime? @map("password_reset_expires") createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") moods Mood[] interventions Intervention[] triggers Trigger[] @@map("users") } model Mood { id Int @id @default(autoincrement()) description String? @db.Text moment DateTime @default(now()) anxietyLevel Int @map("anxiety_level") stressLevel Int @map("stress_level") energyLevel Int @map("energy_level") userId Int @map("user_id") user User @relation(fields: [userId], references: [id]) moodComponents MoodComponent[] @@map("moods") } model MoodComponent { id Int @id @default(autoincrement()) comment String? intensity IntensityLevel @default(LIGHT) moodId Int @map("mood_id") mood Mood @relation(fields: [moodId], references: [id]) @@map("mood_components") } model Intervention { id Int @id @default(autoincrement()) comment String? interventionType InterventionType @map("intervention_type") eficacy Int startAt DateTime @map("start_at") endAt DateTime @map("end_at") userId Int @map("user_id") user User @relation(fields: [userId], references: [id]) @@map("interventions") } model Trigger { id Int @id @default(autoincrement()) comment String? @db.Text category TriggerType userId Int @map("user_id") user User @relation(fields: [userId], references: [id]) @@map("triggers") } enum IntensityLevel { LIGHT MODERATE HIGH } enum InterventionType { MEDICATION THERAPY MEDITATION EXERCISE CONVERSATION } enum TriggerType { SOCIAL ENVIRONMENTAL EMOTIONAL PHYSICAL OTHER }