Skip to content

Commit b237288

Browse files
revert(tables): drop legacy multiselect read-migration
Only local dev tables ever held the removed `multiselect` type (the feature never shipped), so the read-time backward-compat mapping isn't warranted. Keeps the readable contract-validation error from the same change.
1 parent 136f38a commit b237288

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

apps/sim/lib/table/service.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,6 @@ export async function withLockedTable<T>(
8686
* the wire. The client doesn't have to join the two arrays itself — every
8787
* consumer (grid, sidebar, copilot, mothership) gets the same ordered list.
8888
*/
89-
/**
90-
* Backward-compat for the removed `'multiselect'` column type: map it to a
91-
* `select` column with `multiple: true`. Applied on every schema read so legacy
92-
* tables — created before the two types were unified — load, edit, and validate
93-
* under the current model; the migrated shape persists on the table's next
94-
* schema write.
95-
*/
96-
function migrateLegacyColumns(schema: TableSchema): TableSchema {
97-
let mutated = false
98-
const columns = schema.columns.map((c) => {
99-
if ((c.type as string) !== 'multiselect') return c
100-
mutated = true
101-
const { type: _legacyType, ...rest } = c
102-
return { ...rest, type: 'select' as const, multiple: true }
103-
})
104-
return mutated ? { ...schema, columns } : schema
105-
}
106-
10789
function applyColumnOrderToSchema(
10890
schema: TableSchema,
10991
metadata: TableMetadata | null
@@ -169,7 +151,7 @@ export async function getTableById(
169151
id: table.id,
170152
name: table.name,
171153
description: table.description,
172-
schema: applyColumnOrderToSchema(migrateLegacyColumns(table.schema as TableSchema), metadata),
154+
schema: applyColumnOrderToSchema(table.schema as TableSchema, metadata),
173155
metadata,
174156
rowCount: Math.max(0, table.rowCount - pendingDeleteRemaining),
175157
maxRows: table.maxRows,
@@ -233,7 +215,7 @@ export async function listTables(
233215
id: t.id,
234216
name: t.name,
235217
description: t.description,
236-
schema: applyColumnOrderToSchema(migrateLegacyColumns(t.schema as TableSchema), metadata),
218+
schema: applyColumnOrderToSchema(t.schema as TableSchema, metadata),
237219
metadata,
238220
rowCount: Math.max(0, t.rowCount - pendingDeleteRemaining),
239221
maxRows: t.maxRows,

0 commit comments

Comments
 (0)