// 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" output = "../generated/prisma" } datasource db { provider = "sqlite" url = env("DATABASE_URL") } model Response { id Int @id @default(autoincrement()) pleromaNotificationId String @default("null") to String @default("null") request String @default("null") response String @default("null") createdAt DateTime @default(now()) processedAt DateTime? isProcessing Boolean @default(true) isComplete Boolean @default(true) } model User { id Int @id @default(autoincrement()) userFqn String @unique lastRespondedTo DateTime? memory UserMemory? } model Reaction { id Int @id @default(autoincrement()) statusId String // The Pleroma status ID we reacted to emojiName String // The emoji we used to react reactedAt DateTime @default(now()) createdAt DateTime @default(now()) @@unique([statusId]) // Prevent multiple reactions to same status @@map("reactions") } model UserMemory { id Int @id @default(autoincrement()) userFqn String @unique personalityTraits String @default("[]") // JSON string of personality observations runningGags String @default("[]") // JSON string of running jokes/gags relationships String @default("[]") // JSON string of relationship dynamics with bot interests String @default("[]") // JSON string of user interests backstory String @default("[]") // JSON string of biographical elements lastInteractionSummary String? // Brief summary of last chat interactionCount Int @default(0) lastUpdated DateTime @default(now()) @updatedAt createdAt DateTime @default(now()) // Relation to existing User model user User @relation(fields: [userFqn], references: [userFqn]) @@map("user_memories") } model InteractionLog { id Int @id @default(autoincrement()) userFqn String conversationSnapshot String // Key parts of the conversation sentiment String // positive, negative, teasing, etc. extractedTopics String @default("[]") // JSON string of topics discussed memorableQuotes String @default("[]") // JSON string of funny/notable quotes botEmotionalState String? // How the bot should "feel" about this interaction createdAt DateTime @default(now()) @@map("interaction_logs") @@index([userFqn, createdAt]) }