Fix broken migration fallback in CLAUDE.md; add defensive null guards
The documented shadow-database-free fallback for generating migration SQL (--from-migrations ... --to-schema-datamodel ...) was never actually tested and fails for the same P3014 reason `migrate dev` does, since --from-migrations also requires --shadow-database-url internally. Verified against the local dev DB that --from-schema-datasource (live introspection, no shadow DB) diffed against --to-schema-datamodel (static file read) works in both the no-op case and a real ADD COLUMN case, and documented that instead. Also corrected the inaccurate claim that this matched Task 3's approach (Task 3 used --from-empty) and moved the suggested SQL output path out of the repo root into the OS temp directory. Also brings markFailed's errorMessage/errorLog params in line with markDone's existing ?? null guard, and adds orderBy to findExpiredJobs to match findPendingJobs, for consistency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -67,7 +67,7 @@ export async function markDone(prisma, id, { outputPath, outputMimeType, outputS
|
||||
export async function markFailed(prisma, id, { errorMessage, errorLog }) {
|
||||
await prisma.conversionJob.update({
|
||||
where: { id },
|
||||
data: { status: 'failed', errorMessage, errorLog },
|
||||
data: { status: 'failed', errorMessage: errorMessage ?? null, errorLog: errorLog ?? null },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ export async function findPendingJobs(prisma, limit) {
|
||||
export async function findExpiredJobs(prisma) {
|
||||
return prisma.conversionJob.findMany({
|
||||
where: { expiresAt: { lt: new Date() }, cleanedAt: null },
|
||||
orderBy: { createdAt: 'asc' },
|
||||
select: jobSelect,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user