From b28aaa3a936dfc27c9263efc83f6c6e169ad5d3f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 31 Jul 2024 14:22:54 +0200 Subject: [PATCH] Fix --- packages/server/src/api/controllers/table/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/server/src/api/controllers/table/index.ts b/packages/server/src/api/controllers/table/index.ts index ba861064bb..a02ecc665e 100644 --- a/packages/server/src/api/controllers/table/index.ts +++ b/packages/server/src/api/controllers/table/index.ts @@ -17,6 +17,7 @@ import { CsvToJsonRequest, CsvToJsonResponse, FetchTablesResponse, + FieldType, MigrateRequest, MigrateResponse, SaveTableRequest, @@ -178,9 +179,17 @@ export async function validateExistingTableImport( const { rows, tableId } = ctx.request.body let schema = null + if (tableId) { const table = await sdk.tables.getTable(tableId) schema = table.schema + + if (!isExternalTable(table)) { + schema._id = { + name: "_id", + type: FieldType.STRING, + } + } } else { ctx.status = 422 return