Skip to content

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

Remove totalRows from importStatus table

Edward Cui8651c9897c71
diff --git a/server/src/api/import/listSiteImports.ts b/server/src/api/import/listSiteImports.ts
index 43d5dd7d3..9004d7a20 100644
--- a/server/src/api/import/listSiteImports.ts
+++ b/server/src/api/import/listSiteImports.ts
@@ -43,15 +43,11 @@ export async function listSiteImports(
importId: imp.importId,
source: imp.source,
status: imp.status,
- totalRows: imp.totalRows,
processedRows: imp.processedRows,
errorMessage: imp.errorMessage,
startedAt: imp.startedAt, // maybe return import time, or no time data at all
completedAt: imp.completedAt,
fileName: imp.fileName,
- percentage: imp.totalRows
- ? Math.round((imp.processedRows / imp.totalRows) * 100)
- : 0,
}))
});
} catch (error) {
diff --git a/server/src/db/postgres/schema.ts b/server/src/db/postgres/schema.ts
index d409dda9c..1fc6271e7 100644
--- a/server/src/db/postgres/schema.ts
+++ b/server/src/db/postgres/schema.ts
@@ -275,7 +275,6 @@ export const importStatus = pgTable(
organizationId: text("organization_id").notNull(),
source: importSourceEnum("source").notNull(),
status: importStatusEnum("status").notNull().default("pending"),
- totalRows: integer("total_rows"),
processedRows: integer("processed_rows").notNull().default(0),
errorMessage: text("error_message"),
startedAt: timestamp("started_at").notNull().defaultNow(),
diff --git a/server/src/lib/importStatus.ts b/server/src/lib/importStatus.ts
index 2ce7edf1a..5632725a9 100644
--- a/server/src/lib/importStatus.ts
+++ b/server/src/lib/importStatus.ts
@@ -25,16 +25,11 @@ export class ImportStatusManager {
static async updateProgress(
importId: string,
processedRows: number,
- totalRows?: number
): Promise<void> {
const updateData: Partial<InsertImportStatus> = {
processedRows,
};
- if (totalRows !== undefined) {
- updateData.totalRows = totalRows;
- }
-
await db.update(importStatus)
.set(updateData)
.where(eq(importStatus.importId, importId));