Skip to content

Commit c8f4149

Browse files
fix(tables): keep CreateTableData.maxRows so staging callers type-check after merge
1 parent ada0be4 commit c8f4149

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

apps/sim/lib/table/service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ export async function createTable(
258258
// Stamp stable ids so the table is id-keyed from its first row write.
259259
const schema = withGeneratedColumnIds(data.schema)
260260

261-
// Row limits are enforced per-write against the current plan (see assertRowCapacity);
262-
// the stored column is no longer the source of truth, so it just takes the default.
263-
const maxRows = TABLE_LIMITS.MAX_ROWS_PER_TABLE
261+
// Row limits are enforced per-write against the current plan (see assertRowCapacity); the stored
262+
// column is vestigial, so it just takes the caller's value (if any) or the default.
263+
const maxRows = data.maxRows ?? TABLE_LIMITS.MAX_ROWS_PER_TABLE
264264
const maxTables = data.maxTables ?? TABLE_LIMITS.MAX_TABLES_PER_WORKSPACE
265265

266266
const newTable = {

apps/sim/lib/table/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@ export interface CreateTableData {
433433
schema: TableSchema
434434
workspaceId: string
435435
userId: string
436+
/** Optional stored row cap. Vestigial under plan-based enforcement (the column is no longer
437+
* consulted on insert), but retained so callers that still set it type-check. */
438+
maxRows?: number
436439
/** Optional max tables override based on billing plan. Defaults to TABLE_LIMITS.MAX_TABLES_PER_WORKSPACE. */
437440
maxTables?: number
438441
/** Number of empty rows to create with the table. Defaults to 0. */

0 commit comments

Comments
 (0)