Skip to content
Advertisement

Nest Postgresql Sequelize one-to-one Error with ForeignKey

My Table

Has one-to-one connection with table

But when i try add some data in second table< i got an Error – Nest error insert or update on table “checkingResults” violates foreign key constraint “checkingResults_resultId_fkey”

What happened? I try any thing… And how i remember – a don’t get this error before in this place, i don’t touch something in here, but error is here now…

Advertisement

Answer

I just needed to change places in tables with @HasOne and @BelongsTo

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement