mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
prisma package
This commit is contained in:
@ -9,19 +9,29 @@ datasource db {
|
|||||||
|
|
||||||
model User {
|
model User {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
email String @unique @db.VarChar(255)
|
|
||||||
password String @db.VarChar(255)
|
|
||||||
firstName String? @db.VarChar(255)
|
firstName String? @db.VarChar(255)
|
||||||
lastName String? @db.VarChar(255)
|
lastName String? @db.VarChar(255)
|
||||||
|
email String @unique @db.VarChar(255)
|
||||||
|
password String? @db.VarChar(255)
|
||||||
documents Document[]
|
documents Document[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model Document {
|
model Document {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
||||||
userId Int
|
userId Int
|
||||||
recipients Recipient[]
|
|
||||||
document Bytes
|
document Bytes
|
||||||
|
owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
recipients Recipient[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Recipient {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
documentId Int
|
||||||
|
email String @db.VarChar(255)
|
||||||
|
readStatus ReadStatus
|
||||||
|
signingStatus SigningStatus
|
||||||
|
sendStatus SendStatus
|
||||||
|
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SigningStatus {
|
enum SigningStatus {
|
||||||
@ -38,13 +48,3 @@ enum SendStatus {
|
|||||||
NOT_SENT
|
NOT_SENT
|
||||||
SENT
|
SENT
|
||||||
}
|
}
|
||||||
|
|
||||||
model Recipient {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
|
||||||
documentId Int
|
|
||||||
email String @db.VarChar(255)
|
|
||||||
readStatus ReadStatus
|
|
||||||
signingStatus SigningStatus
|
|
||||||
sendStatus SendStatus
|
|
||||||
}
|
|
||||||
|
|||||||
3
packages/prisma/.gitignore
vendored
Normal file
3
packages/prisma/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
# Keep environment variables out of version control
|
||||||
|
.env
|
||||||
3
packages/prisma/index.ts
Normal file
3
packages/prisma/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { PrismaClient, User } from "@prisma/client";
|
||||||
|
|
||||||
|
export default PrismaClient;
|
||||||
97
packages/prisma/package-lock.json
generated
Normal file
97
packages/prisma/package-lock.json
generated
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
"name": "@documenso/prisma",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "@documenso/prisma",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/client": "^4.8.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prisma": "^4.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@prisma/client": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-Y1riB0p2W52kh3zgssP/YAhln3RjBFcJy3uwEiyjmU+TQYh6QTZDRFBo3JtBWuq2FyMOl1Rye8jxzUP+n0l5Cg==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/engines-version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"prisma": "*"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"prisma": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@prisma/engines": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-A1Asn2rxZMlLAj1HTyfaCv0VQrLUv034jVay05QlqZg1qiHPeA3/pGTfNMijbsMYCsGVxfWEJuaZZuNxXGMCrA==",
|
||||||
|
"devOptional": true,
|
||||||
|
"hasInstallScript": true
|
||||||
|
},
|
||||||
|
"node_modules/@prisma/engines-version": {
|
||||||
|
"version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe.tgz",
|
||||||
|
"integrity": "sha512-MHSOSexomRMom8QN4t7bu87wPPD+pa+hW9+71JnVcF3DqyyO/ycCLhRL1we3EojRpZxKvuyGho2REQsMCvxcJw=="
|
||||||
|
},
|
||||||
|
"node_modules/prisma": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-DWIhxvxt8f4h6MDd35mz7BJff+fu7HItW3WPDIEpCR3RzcOWyiHBbLQW5/DOgmf+pRLTjwXQob7kuTZVYUAw5w==",
|
||||||
|
"devOptional": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/engines": "4.8.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"prisma": "build/index.js",
|
||||||
|
"prisma2": "build/index.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/client": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-Y1riB0p2W52kh3zgssP/YAhln3RjBFcJy3uwEiyjmU+TQYh6QTZDRFBo3JtBWuq2FyMOl1Rye8jxzUP+n0l5Cg==",
|
||||||
|
"requires": {
|
||||||
|
"@prisma/engines-version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@prisma/engines": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-A1Asn2rxZMlLAj1HTyfaCv0VQrLUv034jVay05QlqZg1qiHPeA3/pGTfNMijbsMYCsGVxfWEJuaZZuNxXGMCrA==",
|
||||||
|
"devOptional": true
|
||||||
|
},
|
||||||
|
"@prisma/engines-version": {
|
||||||
|
"version": "4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe",
|
||||||
|
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe.tgz",
|
||||||
|
"integrity": "sha512-MHSOSexomRMom8QN4t7bu87wPPD+pa+hW9+71JnVcF3DqyyO/ycCLhRL1we3EojRpZxKvuyGho2REQsMCvxcJw=="
|
||||||
|
},
|
||||||
|
"prisma": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-DWIhxvxt8f4h6MDd35mz7BJff+fu7HItW3WPDIEpCR3RzcOWyiHBbLQW5/DOgmf+pRLTjwXQob7kuTZVYUAw5w==",
|
||||||
|
"devOptional": true,
|
||||||
|
"requires": {
|
||||||
|
"@prisma/engines": "4.8.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
packages/prisma/package.json
Normal file
12
packages/prisma/package.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "@documenso/prisma",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"main": "index.ts",
|
||||||
|
"devDependencies": {
|
||||||
|
"prisma": "^4.8.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@prisma/client": "^4.8.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
50
packages/prisma/schema.prisma
Normal file
50
packages/prisma/schema.prisma
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
generator client {
|
||||||
|
provider = "prisma-client-js"
|
||||||
|
}
|
||||||
|
|
||||||
|
datasource db {
|
||||||
|
provider = "postgresql"
|
||||||
|
url = env("DATABASE_URL")
|
||||||
|
}
|
||||||
|
|
||||||
|
model Document {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
userId Int
|
||||||
|
document Bytes
|
||||||
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
|
Recipient Recipient[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model Recipient {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
documentId Int
|
||||||
|
email String @db.VarChar(255)
|
||||||
|
readStatus ReadStatus
|
||||||
|
signingStatus SigningStatus
|
||||||
|
sendStatus SendStatus
|
||||||
|
Document Document @relation(fields: [documentId], references: [id], onDelete: Cascade)
|
||||||
|
}
|
||||||
|
|
||||||
|
model User {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
firstName String? @db.VarChar(255)
|
||||||
|
lastName String? @db.VarChar(255)
|
||||||
|
email String @unique @db.VarChar(255)
|
||||||
|
password String? @db.VarChar(255)
|
||||||
|
Document Document[]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ReadStatus {
|
||||||
|
NOT_OPENED
|
||||||
|
OPENED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SendStatus {
|
||||||
|
NOT_SENT
|
||||||
|
SENT
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SigningStatus {
|
||||||
|
NOT_SIGNED
|
||||||
|
SIGNED
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user