Files
formbricks-formbricks/prisma/schema.prisma
T
Timothy 844c590d7c Feature/#41 unpublish forms (#59)
* #41: Display message for unpublished forms

* #41: Add publish/unpublish GUI

* #41: Revamp UI and add 'closed' parameter

* change indigo color of access-switch to red

* update live-form on republish, show error message to user in frontend  when form unpublished

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2022-08-17 16:41:22 +02:00

87 lines
2.8 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], onDelete: Cascade)
ownerId Int
formType FormType @default(NOCODE)
name String @default("")
schema Json @default("{}")
submissionSessions SubmissionSession[]
pipelines Pipeline[]
noCodeForm NoCodeForm?
}
model NoCodeForm {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
formId String @unique
blocks Json @default("[]")
blocksDraft Json @default("[]")
published Boolean @default(false)
closed Boolean @default(false)
}
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())
firstname String?
lastname 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")
}