Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

utc import status

Edward Cui86334a2faf36
diff --git a/server/src/db/postgres/schema.ts b/server/src/db/postgres/schema.ts
index 1378c2e77..59e5b6f32 100644
--- a/server/src/db/postgres/schema.ts
+++ b/server/src/db/postgres/schema.ts
@@ -285,8 +285,8 @@ export const importStatus = pgTable(
status: importStatusEnum("status").notNull().default("pending"),
importedEvents: integer("imported_events").notNull().default(0),
errorMessage: text("error_message"),
- startedAt: timestamp("started_at").notNull().defaultNow(),
- completedAt: timestamp("completed_at"),
+ startedAt: timestamp("started_at", { mode: "string" }).notNull().defaultNow(),
+ completedAt: timestamp("completed_at", { mode: "string" }),
fileName: text("file_name").notNull(),
fileSize: bigint("file_size", { mode: "number" }).notNull(),
},
diff --git a/server/src/services/import/importStatusManager.ts b/server/src/services/import/importStatusManager.ts
index a7db25412..a9663ac8e 100644
--- a/server/src/services/import/importStatusManager.ts
+++ b/server/src/services/import/importStatusManager.ts
@@ -1,6 +1,7 @@
import { db } from "../../db/postgres/postgres.js";
import { eq, desc, sql } from "drizzle-orm";
import { importStatus } from "../../db/postgres/schema.js";
+import { DateTime } from "luxon";
type SelectImportStatus = typeof importStatus.$inferSelect;
type InsertImportStatus = typeof importStatus.$inferInsert;
@@ -15,7 +16,7 @@ export class ImportStatusManager {
status: InsertImportStatus["status"],
errorMessage?: string
): Promise<void> {
- const completedAt = status === "completed" || status === "failed" ? new Date() : null;
+ const completedAt = status === "completed" || status === "failed" ? DateTime.utc().toISO() : null;
await db
.update(importStatus)