keep job creation date as text for compatibility
This commit is contained in:
parent
882b4db228
commit
f3fa0a1944
3 changed files with 3 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ CREATE TABLE "users" (
|
||||||
CREATE TABLE "jobs" (
|
CREATE TABLE "jobs" (
|
||||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
"user_id" INTEGER NOT NULL,
|
"user_id" INTEGER NOT NULL,
|
||||||
"date_created" DATETIME NOT NULL,
|
"date_created" TEXT NOT NULL,
|
||||||
"status" TEXT NOT NULL DEFAULT 'not started',
|
"status" TEXT NOT NULL DEFAULT 'not started',
|
||||||
"num_files" INTEGER NOT NULL DEFAULT 0,
|
"num_files" INTEGER NOT NULL DEFAULT 0,
|
||||||
CONSTRAINT "jobs_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
CONSTRAINT "jobs_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
|
@ -31,7 +31,7 @@ model Job {
|
||||||
/// The ID of the user who created the job
|
/// The ID of the user who created the job
|
||||||
userId Int @map("user_id")
|
userId Int @map("user_id")
|
||||||
/// The date and time when the job was created
|
/// The date and time when the job was created
|
||||||
dateCreated DateTime @map("date_created")
|
dateCreated String @map("date_created")
|
||||||
/// The current status of the job
|
/// The current status of the job
|
||||||
status String @default("not started")
|
status String @default("not started")
|
||||||
/// The number of files associated with the job
|
/// The number of files associated with the job
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ const clearJobs = async () => {
|
||||||
const jobs = await prisma.job.findMany({
|
const jobs = await prisma.job.findMany({
|
||||||
where: {
|
where: {
|
||||||
dateCreated: {
|
dateCreated: {
|
||||||
lt: new Date(Date.now() - AUTO_DELETE_EVERY_N_HOURS * 60 * 60 * 1000),
|
lt: new Date(Date.now() - AUTO_DELETE_EVERY_N_HOURS * 60 * 60 * 1000).toISOString(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue