diff --git a/prisma/migrations/20251106204934_init/migration.sql b/prisma/migrations/20251107223935_init/migration.sql similarity index 96% rename from prisma/migrations/20251106204934_init/migration.sql rename to prisma/migrations/20251107223935_init/migration.sql index e234662..b56e29a 100644 --- a/prisma/migrations/20251106204934_init/migration.sql +++ b/prisma/migrations/20251107223935_init/migration.sql @@ -9,7 +9,7 @@ CREATE TABLE "users" ( CREATE TABLE "jobs" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "user_id" INTEGER NOT NULL, - "date_created" DATETIME NOT NULL, + "date_created" TEXT NOT NULL, "status" TEXT NOT NULL DEFAULT 'not started', "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 diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 606a398..27c0313 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -31,7 +31,7 @@ model Job { /// The ID of the user who created the job userId Int @map("user_id") /// 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 status String @default("not started") /// The number of files associated with the job diff --git a/src/index.tsx b/src/index.tsx index 51b934d..9def766 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -69,7 +69,7 @@ const clearJobs = async () => { const jobs = await prisma.job.findMany({ where: { 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(), }, }, });