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:
@@ -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)
|
||||
@@ -32,12 +32,12 @@ model ConversionJob {
|
||||
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")
|
||||
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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user