{"record":{"id":"40ab246d8d6d4c28","repo":"n8n-io/n8n","slug":"column-column-propertyname-of-entity-entityme","errorCode":null,"errorMessage":"Column ${column.propertyName} of Entity ${entityMetadata.name} does not support length property.","messagePattern":"Column (.+?) of Entity (.+?) does not support length property\\.","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/metadata-builder/EntityMetadataValidator.ts","lineNumber":116,"sourceCode":"\t\t\t\t\t`Entities ${entityMetadata.name} and ${sameDiscriminatorValueEntityMetadata.name} have the same discriminator values. Make sure they are different while using the @ChildEntity decorator.`,\n\t\t\t\t);\n\t\t}\n\n\t\tentityMetadata.relationCounts.forEach((relationCount) => {\n\t\t\tif (relationCount.relation.isManyToOne || relationCount.relation.isOneToOne)\n\t\t\t\tthrow new TypeORMError(\n\t\t\t\t\t`Relation count can not be implemented on ManyToOne or OneToOne relations.`,\n\t\t\t\t);\n\t\t});\n\n\t\tentityMetadata.columns\n\t\t\t.filter((column) => !column.isVirtualProperty)\n\t\t\t.forEach((column) => {\n\t\t\t\tconst normalizedColumn = driver.normalizeType(column) as ColumnType;\n\t\t\t\tif (driver.supportedDataTypes.indexOf(normalizedColumn) === -1)\n\t\t\t\t\tthrow new DataTypeNotSupportedError(column, normalizedColumn, driver.options.type);\n\t\t\t\tif (column.length && driver.withLengthColumnTypes.indexOf(normalizedColumn) === -1)\n\t\t\t\t\tthrow new TypeORMError(\n\t\t\t\t\t\t`Column ${column.propertyName} of Entity ${entityMetadata.name} does not support length property.`,\n\t\t\t\t\t);\n\t\t\t\tif (column.type === 'enum' && !column.enum && !column.enumName)\n\t\t\t\t\tthrow new TypeORMError(\n\t\t\t\t\t\t`Column \"${column.propertyName}\" of Entity \"${entityMetadata.name}\" is defined as enum, but missing \"enum\" or \"enumName\" properties.`,\n\t\t\t\t\t);\n\t\t\t});\n\n\t\t// Postgres supports only STORED generated columns.\n\t\tif (driver.options.type === 'postgres') {\n\t\t\tconst virtualColumn = entityMetadata.columns.find(\n\t\t\t\t(column) =>\n\t\t\t\t\tcolumn.asExpression && (!column.generatedType || column.generatedType === 'VIRTUAL'),\n\t\t\t);\n\t\t\tif (virtualColumn)\n\t\t\t\tthrow new TypeORMError(\n\t\t\t\t\t`Column \"${virtualColumn.propertyName}\" of Entity \"${entityMetadata.name}\" is defined as VIRTUAL, but Postgres supports only STORED generated columns.`,\n\t\t\t\t);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/metadata-builder/EntityMetadataValidator.ts#L98-L134","documentation":"Thrown by EntityMetadataValidator.validate when a column has a length set (column.length truthy) but its normalized type is not in driver.withLengthColumnTypes. Length applies only to a known subset of types (e.g. varchar, varbinary); attaching length to a type that does not honor it is rejected.","triggerScenarios":"Setting { length: 255 } on a column whose type does not appear in withLengthColumnTypes for the active driver (e.g. boolean, integer, text, json).","commonSituations":"Copy-pasting a varchar column options object onto a non-length type; misunderstanding which types accept length on a given driver; migrating from MySQL (where int length is silently accepted) to postgres (where it is not).","solutions":["Remove the length option from the column, or change the column type to one that supports length (varchar, char, varbinary).","Consult driver.withLengthColumnTypes for your database before setting length.","Use precision/scale for decimals rather than length."],"exampleFix":"// before\n@Column({ type: 'int', length: 11 }) count: number;\n\n// after\n@Column({ type: 'int' }) count: number;","handlingStrategy":"validation","validationCode":"function assertNoInvalidLengths(dataSource: DataSource): string[] {\n  const withLength = new Set(dataSource.driver.withLengthColumnTypes as string[]);\n  const problems: string[] = [];\n  for (const meta of dataSource.entityMetadatas) {\n    for (const col of meta.columns.filter((c) => !c.isVirtualProperty)) {\n      if (col.length && !withLength.has(dataSource.driver.normalizeType(col) as string)) {\n        problems.push(`${meta.targetName}.${col.propertyName} declares length but its type does not accept it`);\n      }\n    }\n  }\n  return problems;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await dataSource.initialize();\n} catch (err) {\n  if (err.message.includes('does not support length property')) {\n    // drop the length option or change the column type\n  }\n  throw err;\n}","preventionTips":["Before setting length on a column, confirm its normalized type is in driver.withLengthColumnTypes.","Run the post-init length validator in CI for every driver target.","Use precision/scale for numeric types instead of length."],"tags":["column-length","datatype","metadata","startup"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}