Skip to content

Commit

Permalink
Truncate table name to 32 characters (#4580)
Browse files Browse the repository at this point in the history
* Truncate table name to 32 characters

* Use 64

* Revert "Use 64"

This reverts commit e8f505f.
  • Loading branch information
flvndvd committed May 26, 2024
1 parent 5074184 commit 2efe0f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion types/src/shared/utils/structured_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 2efe0f0

Please sign in to comment.