-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f83b8e2
commit 1396ba7
Showing
7 changed files
with
107 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
dist | ||
yarn-error.log | ||
docs/out | ||
packages/adapter-prisma/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model FileAttachment { | ||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid | ||
name String @db.VarChar | ||
recordType String @db.VarChar | ||
recordId String @db.Uuid | ||
blobId String @db.Uuid | ||
createdAt DateTime @default(now()) @db.Timestamptz(6) | ||
blob FileBlob @relation(fields: [blobId], references: [id]) | ||
@@unique([recordType, recordId, name, blobId]) | ||
@@index([recordType, recordId, name]) | ||
@@index([blobId]) | ||
} | ||
|
||
model FileBlob { | ||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid | ||
serviceName String @db.VarChar | ||
key String @unique @db.VarChar | ||
fileName String @db.VarChar | ||
contentType String? @db.VarChar | ||
size BigInt | ||
checksum String @db.VarChar | ||
metadata Json @default("{}") | ||
createdAt DateTime @default(now()) @db.Timestamptz(6) | ||
attachments FileAttachment[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.