45 lines
2.0 KiB
Plaintext
45 lines
2.0 KiB
Plaintext
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
enum JobStatus {
|
|
pending
|
|
processing
|
|
done
|
|
failed
|
|
}
|
|
|
|
model ConversionJob {
|
|
id Int @id @default(autoincrement()) @db.UnsignedInt
|
|
uuid String @unique(map: "uniq_uuid") @db.Char(36)
|
|
status JobStatus @default(pending)
|
|
family String @db.VarChar(32)
|
|
sourceFormat String @map("source_format") @db.VarChar(16)
|
|
targetFormat String @map("target_format") @db.VarChar(16)
|
|
originalFilename String @map("original_filename") @db.VarChar(255)
|
|
inputPath String @map("input_path") @db.VarChar(255)
|
|
outputPath String? @map("output_path") @db.VarChar(255)
|
|
inputMimeType String @map("input_mime_type") @db.VarChar(128)
|
|
outputMimeType String? @map("output_mime_type") @db.VarChar(128)
|
|
inputSizeBytes Int @map("input_size_bytes") @db.UnsignedInt
|
|
outputSizeBytes Int? @map("output_size_bytes") @db.UnsignedInt
|
|
quality Int? @db.UnsignedSmallInt
|
|
iconSize Int? @map("icon_size") @db.UnsignedSmallInt
|
|
conversionDurationSeconds Decimal? @map("conversion_duration_seconds") @db.Decimal(10, 3)
|
|
errorMessage String? @map("error_message") @db.VarChar(255)
|
|
errorLog String? @map("error_log") @db.Text
|
|
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(0)
|
|
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.DateTime(0)
|
|
expiresAt DateTime @map("expires_at") @db.DateTime(0)
|
|
cleanedAt DateTime? @map("cleaned_at") @db.DateTime(0)
|
|
|
|
@@index([status], map: "idx_status")
|
|
@@index([expiresAt], map: "idx_expires_at")
|
|
@@map("conversion_jobs")
|
|
}
|