{"record":{"id":"5e8037e5ce415436","repo":"n8n-io/n8n","slug":"column-column-propertyname-of-entity-entit","errorCode":null,"errorMessage":"Column \"${column.propertyName}\" of Entity \"${entityMetadata.name}\" is defined as enum, but missing \"enum\" or \"enumName\" properties.","messagePattern":"Column \"(.+?)\" of Entity \"(.+?)\" is defined as enum, but missing \"enum\" or \"enumName\" properties\\.","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/metadata-builder/EntityMetadataValidator.ts","lineNumber":120,"sourceCode":"\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);\n\t\t}\n\n\t\t// check if relations are all without initialized properties\n\t\tconst entityInstance = entityMetadata.create(undefined, {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/metadata-builder/EntityMetadataValidator.ts#L102-L138","documentation":"Thrown by EntityMetadataValidator.validate when a column has type 'enum' but neither enum (the value array) nor enumName (the named enum for schema sync) is set. TypeORM needs one of these to materialize the enum type in the database and to validate values.","triggerScenarios":"Declaring @Column({ type: 'enum' }) without also passing enum: MyEnum or enumName: 'my_enum'.","commonSituations":"Authoring an enum column hastily; refactoring from a string column to enum and forgetting the enum reference; relying on type inference alone (which is not enough for the enum column type).","solutions":["Pass the TypeScript enum object: @Column({ type: 'enum', enum: StatusEnum }).","For named enums (recommended when using migrations/sync), also set enumName: 'status_enum'.","If you did not mean an enum, switch the type to 'text'/'varchar' and store strings."],"exampleFix":"// before\n@Column({ type: 'enum' }) status: StatusEnum;\n\n// after\n@Column({ type: 'enum', enum: StatusEnum, enumName: 'status_enum' })\nstatus: StatusEnum;","handlingStrategy":"validation","validationCode":"function assertEnumColumnsConfigured(dataSource: DataSource): string[] {\n  const problems: string[] = [];\n  for (const meta of dataSource.entityMetadatas) {\n    for (const col of meta.columns) {\n      if (col.type === 'enum' && !col.enum && !col.enumName) {\n        problems.push(`${meta.targetName}.${col.propertyName} is enum but missing enum/enumName`);\n      }\n    }\n  }\n  return problems;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await dataSource.initialize();\n} catch (err) {\n  if (err.message.includes('defined as enum, but missing')) {\n    // add enum: MyEnum (and enumName) to the column options\n  }\n  throw err;\n}","preventionTips":["Always pair type: 'enum' with the TypeScript enum object and an explicit enumName.","Run the post-init enum-column validator in CI.","On enum removal, audit every column that referenced it."],"tags":["enum","column","metadata","startup"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}