From 2efe0f03d6da4f867c575ccfc11ba70440661c51 Mon Sep 17 00:00:00 2001 From: Flavien David Date: Fri, 5 Apr 2024 11:32:30 +0200 Subject: [PATCH] Truncate table name to 32 characters (#4580) * Truncate table name to 32 characters * Use 64 * Revert "Use 64" This reverts commit e8f505f8f05ae9f4abb02b66334533e500f43c52. --- types/src/shared/utils/structured_data.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/src/shared/utils/structured_data.ts b/types/src/shared/utils/structured_data.ts index 3b3573988876..e70a49e23dbc 100644 --- a/types/src/shared/utils/structured_data.ts +++ b/types/src/shared/utils/structured_data.ts @@ -4,7 +4,10 @@ export function makeStructuredDataTableName(name: string, externalId: string) { const lowercasedExternalId = externalId.toLowerCase(); const externalIdPrefix = lowercasedExternalId.substring(0, 4); const externalIdSuffix = lowercasedExternalId.slice(-4); - return slugify(`${name}_${externalIdPrefix}_${externalIdSuffix}`); + + const truncatedName = name.substring(0, 32); + + return slugify(`${truncatedName}_${externalIdPrefix}_${externalIdSuffix}`); } export class InvalidStructuredDataHeaderError extends Error {}