mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
86 lines
2.6 KiB
Plaintext
86 lines
2.6 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
enum FormType {
|
|
CODE
|
|
NOCODE
|
|
}
|
|
|
|
enum PipelineType {
|
|
WEBHOOK
|
|
}
|
|
|
|
model Form {
|
|
id String @id
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
owner User @relation(fields: [ownerId], references: [id])
|
|
ownerId Int
|
|
formType FormType @default(NOCODE)
|
|
name String
|
|
published Boolean @default(false)
|
|
finishedOnboarding Boolean @default(false)
|
|
schema Json
|
|
submissionSessions SubmissionSession[]
|
|
pipelines Pipeline[]
|
|
}
|
|
|
|
model Pipeline {
|
|
id String @id @default(uuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
type PipelineType
|
|
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
|
|
formId String
|
|
data Json
|
|
}
|
|
|
|
model SubmissionSession {
|
|
id String @id @default(uuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
|
|
formId String
|
|
userFingerprint String
|
|
events SessionEvent[]
|
|
}
|
|
|
|
model SessionEvent {
|
|
id String @id @default(uuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
submissionSession SubmissionSession @relation(fields: [submissionSessionId], references: [id], onDelete: Cascade)
|
|
submissionSessionId String
|
|
type String
|
|
data Json
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
name String?
|
|
email String? @unique
|
|
emailVerified DateTime? @map(name: "email_verified")
|
|
password String?
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
forms Form[]
|
|
|
|
@@map(name: "users")
|
|
}
|
|
|
|
model VerificationRequest {
|
|
id Int @id @default(autoincrement())
|
|
identifier String
|
|
token String @unique
|
|
expires DateTime
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @default(now()) @map(name: "updated_at")
|
|
|
|
@@map(name: "verification_requests")
|
|
} |