Skip to content

Commit

Permalink
fix(mapping): allow using custom types on primary keys
Browse files Browse the repository at this point in the history
Related: #361
  • Loading branch information
Martin Adamek committed Feb 27, 2020
1 parent aeb50df commit ff2b7c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/metadata/MetadataDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ export class MetadataDiscovery {
}

const meta = this.metadata.get(prop.type);
prop.columnType = this.schemaHelper.getTypeDefinition(meta.properties[meta.primaryKey]);
const pk = meta.properties[meta.primaryKey];
this.initCustomType(pk);
prop.columnType = this.schemaHelper.getTypeDefinition(pk);
}

private initEnumValues(prop: EntityProperty, path: string): void {
Expand Down

0 comments on commit ff2b7c9

Please sign in to comment.