mirror of
https://github.com/vitalityAI/therapist.git
synced 2025-04-08 05:40:17 -04:00
42 lines
778 B
Plaintext
42 lines
778 B
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
datasource db {
|
|
provider = "mongodb"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|
|
|
startedAt DateTime @default(now())
|
|
transferedAt DateTime?
|
|
endedAt DateTime?
|
|
|
|
callId String @unique
|
|
callerPhone String @unique
|
|
receiverPhone String? @unique
|
|
messages Message[]
|
|
}
|
|
|
|
enum Role {
|
|
USER
|
|
BOT
|
|
REP
|
|
}
|
|
|
|
model Message {
|
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|
|
|
createdAt DateTime @default(now())
|
|
role Role
|
|
content String
|
|
|
|
session Session @relation(fields: [sessionId], references: [id])
|
|
sessionId String @db.ObjectId
|
|
}
|