mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
🎨 schema format
This commit is contained in:
@ -7,53 +7,9 @@ datasource db {
|
|||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Document {
|
enum IdentityProvider {
|
||||||
id Int @id @default(autoincrement())
|
DOCUMENSO
|
||||||
userId Int
|
GOOGLE
|
||||||
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
||||||
title String
|
|
||||||
status DocumentStatus @default(DRAFT)
|
|
||||||
document String
|
|
||||||
Recipient Recipient[]
|
|
||||||
Field Field[]
|
|
||||||
}
|
|
||||||
|
|
||||||
model Field {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
documentId Int
|
|
||||||
recipientId Int?
|
|
||||||
type FieldType
|
|
||||||
page Int
|
|
||||||
positionX Int @default(0)
|
|
||||||
positionY Int @default(0)
|
|
||||||
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
|
||||||
Recipient Recipient? @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
|
||||||
Signature Signature?
|
|
||||||
}
|
|
||||||
|
|
||||||
model Signature {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
created DateTime @default(now())
|
|
||||||
recipientId Int
|
|
||||||
fieldId Int @unique
|
|
||||||
signatureImageAsBase64 String
|
|
||||||
|
|
||||||
Recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Restrict)
|
|
||||||
Field Field @relation(fields: [fieldId], references: [id], onDelete: Restrict)
|
|
||||||
}
|
|
||||||
|
|
||||||
model Recipient {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
documentId Int
|
|
||||||
email String @db.VarChar(255)
|
|
||||||
name String @default("") @db.VarChar(255)
|
|
||||||
token String
|
|
||||||
readStatus ReadStatus @default(NOT_OPENED)
|
|
||||||
signingStatus SigningStatus @default(NOT_SIGNED)
|
|
||||||
sendStatus SendStatus @default(NOT_SENT)
|
|
||||||
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
|
||||||
Field Field[]
|
|
||||||
Signature Signature[]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
@ -95,15 +51,21 @@ model Session {
|
|||||||
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum FieldType {
|
enum DocumentStatus {
|
||||||
SIGNATURE
|
DRAFT
|
||||||
DATE
|
PENDING
|
||||||
TEXT
|
COMPLETED
|
||||||
}
|
}
|
||||||
|
|
||||||
enum IdentityProvider {
|
model Document {
|
||||||
DOCUMENSO
|
id Int @id @default(autoincrement())
|
||||||
GOOGLE
|
userId Int
|
||||||
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
title String
|
||||||
|
status DocumentStatus @default(DRAFT)
|
||||||
|
document String
|
||||||
|
Recipient Recipient[]
|
||||||
|
Field Field[]
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ReadStatus {
|
enum ReadStatus {
|
||||||
@ -121,8 +83,46 @@ enum SigningStatus {
|
|||||||
SIGNED
|
SIGNED
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DocumentStatus {
|
model Recipient {
|
||||||
DRAFT
|
id Int @id @default(autoincrement())
|
||||||
PENDING
|
documentId Int
|
||||||
COMPLETED
|
email String @db.VarChar(255)
|
||||||
|
name String @default("") @db.VarChar(255)
|
||||||
|
token String
|
||||||
|
readStatus ReadStatus @default(NOT_OPENED)
|
||||||
|
signingStatus SigningStatus @default(NOT_SIGNED)
|
||||||
|
sendStatus SendStatus @default(NOT_SENT)
|
||||||
|
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||||
|
Field Field[]
|
||||||
|
Signature Signature[]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum FieldType {
|
||||||
|
SIGNATURE
|
||||||
|
DATE
|
||||||
|
TEXT
|
||||||
|
}
|
||||||
|
|
||||||
|
model Field {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
documentId Int
|
||||||
|
recipientId Int?
|
||||||
|
type FieldType
|
||||||
|
page Int
|
||||||
|
positionX Int @default(0)
|
||||||
|
positionY Int @default(0)
|
||||||
|
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||||
|
Recipient Recipient? @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
||||||
|
Signature Signature?
|
||||||
|
}
|
||||||
|
|
||||||
|
model Signature {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
created DateTime @default(now())
|
||||||
|
recipientId Int
|
||||||
|
fieldId Int @unique
|
||||||
|
signatureImageAsBase64 String
|
||||||
|
|
||||||
|
Recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Restrict)
|
||||||
|
Field Field @relation(fields: [fieldId], references: [id], onDelete: Restrict)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user