Skip to content

Commit

Permalink
fix(core): do not fail when detecting mapped type for enum columns
Browse files Browse the repository at this point in the history
When `reflect-metadata` is not available and `type` is not explicitly set.

Closes #2323
  • Loading branch information
B4nan committed Jul 14, 2023
1 parent d7f362e commit b94048b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/metadata/MetadataDiscovery.ts
Expand Up @@ -1118,7 +1118,7 @@ export class MetadataDiscovery {
}

private getMappedType(prop: EntityProperty): Type<unknown> {
let t = prop.columnTypes?.[0] ?? prop.type.toLowerCase();
let t = prop.columnTypes?.[0] ?? prop.type?.toLowerCase();

if (prop.enum) {
t = prop.items?.every(item => Utils.isString(item)) ? 'enum' : 'tinyint';
Expand Down

0 comments on commit b94048b

Please sign in to comment.