From a9ea2a99b4615d106f94179b5f232a668b09d493 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 18 Apr 2026 22:44:52 +0100 Subject: [PATCH] chore(server): let seed-base-rows script take row count via env var --- apps/server/src/scripts/seed-base-rows.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/server/src/scripts/seed-base-rows.ts b/apps/server/src/scripts/seed-base-rows.ts index a9e2ef39..5b485920 100644 --- a/apps/server/src/scripts/seed-base-rows.ts +++ b/apps/server/src/scripts/seed-base-rows.ts @@ -6,7 +6,7 @@ import postgres from 'postgres'; import { v7 as uuid7 } from 'uuid'; import { generateJitteredKeyBetween } from 'fractional-indexing-jittered'; -const TOTAL_ROWS = 1500; +const TOTAL_ROWS = Number(process.env.TOTAL_ROWS) || 1500; const BATCH_SIZE = 2000; const envFilePath = path.resolve(process.cwd(), '..', '..', '.env'); @@ -167,7 +167,8 @@ function buildCellGenerator(property: any): CellGenerator | null { async function createBase(workspaceId: string, spaceId: string, creatorId: string | null): Promise { const baseId = uuid7(); - const baseName = `Seed Base ${new Date().toISOString().slice(0, 16)}`; + const rowCountLabel = TOTAL_ROWS >= 1000 ? `${Math.round(TOTAL_ROWS / 1000)}K` : `${TOTAL_ROWS}`; + const baseName = `Seed Base ${rowCountLabel} rows`; await db.insertInto('bases').values({ id: baseId,