mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-17 09:51:14 -05:00
* add PMF results dashboard * add PMF Segmentation View * add PMF setup instructions * Built new Filter Navigation that is also used in Feedback Co-authored-by: knugget <johannes@knugget.de>
161 lines
4.8 KiB
Plaintext
161 lines
4.8 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
//provider = "prisma-dbml-generator"
|
|
}
|
|
|
|
enum PipelineType {
|
|
webhook
|
|
emailNotification
|
|
slackNotification
|
|
}
|
|
|
|
enum PipelineEvent {
|
|
submissionCreated
|
|
submissionUpdated
|
|
submissionFinished
|
|
}
|
|
|
|
model Pipeline {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
label String
|
|
type PipelineType
|
|
events PipelineEvent[]
|
|
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
|
|
formId String
|
|
enabled Boolean @default(true)
|
|
config Json @default("{}")
|
|
}
|
|
|
|
model Customer {
|
|
email String
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
workspaceId String
|
|
submissions Submission[]
|
|
data Json @default("{}")
|
|
|
|
@@id([email, workspaceId])
|
|
}
|
|
|
|
enum FormType {
|
|
custom
|
|
feedback
|
|
pmf
|
|
}
|
|
|
|
model Form {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
type FormType
|
|
label String
|
|
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
workspaceId String
|
|
schema Json @default("{}")
|
|
submissions Submission[]
|
|
pipelines Pipeline[]
|
|
}
|
|
|
|
model Submission {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
finished Boolean @default(false)
|
|
archived Boolean @default(false)
|
|
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
|
|
formId String
|
|
customer Customer? @relation(fields: [customerEmail, customerWorkspaceId], references: [email, workspaceId])
|
|
customerEmail String?
|
|
customerWorkspaceId String?
|
|
data Json @default("{}")
|
|
meta Json @default("{}")
|
|
}
|
|
|
|
model Workspace {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
name String
|
|
members Membership[]
|
|
forms Form[]
|
|
customers Customer[]
|
|
}
|
|
|
|
enum MembershipRole {
|
|
member
|
|
admin
|
|
owner
|
|
}
|
|
|
|
model Membership {
|
|
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
workspaceId String
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String
|
|
accepted Boolean @default(false)
|
|
role MembershipRole
|
|
|
|
@@id([userId, workspaceId])
|
|
}
|
|
|
|
model ApiKey {
|
|
id String @id @unique @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
lastUsedAt DateTime?
|
|
label String?
|
|
hashedKey String @unique()
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String
|
|
}
|
|
|
|
enum IdentityProvider {
|
|
email
|
|
github
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String
|
|
type String
|
|
provider String
|
|
providerAccountId String
|
|
access_token String? @db.Text
|
|
refresh_token String? @db.Text
|
|
expires_at Int?
|
|
token_type String?
|
|
scope String?
|
|
id_token String? @db.Text
|
|
session_state String?
|
|
|
|
@@unique([provider, providerAccountId])
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
name String?
|
|
email String @unique
|
|
emailVerified DateTime? @map(name: "email_verified")
|
|
password String?
|
|
identityProvider IdentityProvider @default(email)
|
|
identityProviderAccountId String?
|
|
workspaces Membership[]
|
|
accounts Account[]
|
|
apiKeys ApiKey[]
|
|
}
|