Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

394
Views
Remove an index from a one-to-one relationship [TypeORM]

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. enter image description here

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 ❤️

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I've found ! It is possible to add create createForeignKeyConstraints: false to delete the index of a relation

@OneToOne(() => Table, {
    cascade: true,
    createForeignKeyConstraints: false
})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!