Duplicate underscore in oneToMany
Helveg opened this issue · 2 comments
Helveg commented
Using an entity with a column like this:
@ManyToOne(() => Degree, { nullable: true })
@JoinColumn()
parentDegree?: Degree;
yields the column name parent_degree__id
instead of parent_degree_id
Jarreddebeer commented
I suspect it could be because of the .concat('') in this line:
since ['a'].concat('') results in ['a', '']; and then ['a', ''].join('_') results in 'a_'. So if like me you had {'prefix': 'a_'} the column name would end up 'a__id' not 'a_id'
Helveg commented
Thanks. I will investigate