Issue
I would like to know if it is possible to drop an index from a one-to-one relationship with TypeORM.
@OneToOne(() => Customer, {
cascade: true
})
@JoinColumn({
name: 'customer',
referencedColumnName: 'uid'
})
customer: Customer
I looked on the doc and didn't find anything interesting, tried things that I found on google like used @Index() but nothing conclusive as well.
I cannot add another row because I have this error message showing
ER_DUP_ENTRY: Duplicate entry 'f57c' for key 'REL_e8ed1ed567c8f9315acc836631'
Thank you in advance for your help ❤️
Solution
I've found ! It is possible to add create createForeignKeyConstraints: false to delete the index of a relation
@OneToOne(() => Table, {
cascade: true,
createForeignKeyConstraints: false
})
Answered By - alexandre_plt
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.