Review of Task 1 (d86245a) found two issues:
1. prisma/schema.prisma didn't reproduce db/schema.sql's DDL exactly.
Add @db.DateTime(0) to createdAt/updatedAt/expiresAt/cleanedAt (Prisma
otherwise defaults to DATETIME(3)), and explicit map: names on the
uuid unique constraint and status/expiresAt indexes so they match the
real table's uniq_uuid/idx_status/idx_expires_at. Verified via
`prisma migrate diff --from-empty --to-schema-datamodel`, which now
shows DATETIME(0)/CURRENT_TIMESTAMP(0) and the correct names. Table
collation and updated_at's ON UPDATE CURRENT_TIMESTAMP remain
documented, accepted gaps with no schema-level fix in Prisma's mysql
provider.
2. The original @prisma/client@6/prisma@6 pin used --force without
diagnosing why. Reinstalled with `npm install @prisma/client@6
prisma@6 --save-dev` (no --force) directly against this project's
node_modules: it completed cleanly with no conflicts, confirming
--force was unnecessary.
`prisma validate`, `prisma generate`, and the full test suite
(69 passed, 4 pre-existing failures unrelated to this change) all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
44 lines
1.9 KiB
Plaintext
44 lines
1.9 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
|
|
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")
|
|
}
|