Fix Task 1 schema.prisma for exact DDL fidelity and drop --force

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>
This commit is contained in:
2026-07-31 01:07:34 +02:00
co-authored by Claude Sonnet 5
parent 3f1280be33
commit 1ebff25603
+14 -14
View File
@@ -16,7 +16,7 @@ enum JobStatus {
model ConversionJob {
id Int @id @default(autoincrement()) @db.UnsignedInt
uuid String @unique @db.Char(36)
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)
@@ -25,19 +25,19 @@ model ConversionJob {
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")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
expiresAt DateTime @map("expires_at")
cleanedAt DateTime? @map("cleaned_at")
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])
@@index([expiresAt])
@@index([status], map: "idx_status")
@@index([expiresAt], map: "idx_expires_at")
@@map("conversion_jobs")
}