65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
// 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 Account {
|
|
id Int @id @default(autoincrement())
|
|
driveType String @unique
|
|
accountIdentifier String
|
|
credentials String @db.Text
|
|
status String @default("active")
|
|
lastChecked DateTime?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
transcodeRecords TranscodeRecord[]
|
|
activityLogs ActivityLog[]
|
|
}
|
|
|
|
model TranscodeRecord {
|
|
id Int @id @default(autoincrement())
|
|
itemId String
|
|
sourceLink String @db.Text
|
|
driveType String
|
|
managedAccountId Int
|
|
status String @default("pending")
|
|
tempLink String? @db.Text
|
|
transferredFileId String?
|
|
transferStartTime DateTime @default(now())
|
|
transferEndTime DateTime?
|
|
errorCode String?
|
|
errorMessage String? @db.Text
|
|
cleanupStatus String @default("pending")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
account Account @relation(fields: [managedAccountId], references: [id])
|
|
|
|
@@index([itemId])
|
|
@@index([cleanupStatus])
|
|
}
|
|
|
|
model ActivityLog {
|
|
id BigInt @id @default(autoincrement())
|
|
timestamp DateTime @default(now())
|
|
operationType String
|
|
clientIp String?
|
|
keyword String?
|
|
itemId String?
|
|
driveType String?
|
|
managedAccountId Int?
|
|
generatedLink String? @db.Text
|
|
errorCode String?
|
|
errorMessage String? @db.Text
|
|
durationMs Int?
|
|
details String? @db.Text
|
|
account Account? @relation(fields: [managedAccountId], references: [id])
|
|
|
|
@@index([itemId])
|
|
} |