I have two entities defined like this:Membership Entity:@Entity() export default class Membership extends BaseEntity { @PrimaryColumn("uuid") id: string; @OneToOne(type => Member, member => member.membership) member: Member } Member Entity:@Entity() export default class Membership extends BaseEntity { @PrimaryColumn("uuid") id: string; @OneToOne(type => Membership, membership => membership.member) @JoinColumn() membership: Membership } This setup works fine when I create a member (A) and hook it up to a membership (M). However, I get a Duplicate Entry Error when I try to add another member (B) and hook it up to the same membership (M).Can anyone please help me out. I'm pretty new to typeorm and mysql and would love to have your opinion on the issue.Thanks!
Submitted May 03, 2020 at 08:50PM by wise_introvert
No comments:
Post a Comment