Foreign key constraint violation after import into postgresql

System Information
  • Strapi Version: 4.10.5
  • Operating System: Windows 11, WSL Ubuntu LTS
  • Database: Postgresql (from sqlite)
  • Node Version: 18.14.2
  • NPM Version: 9.5.0

After I exported my database from Sqlite, and imported it to Postgresql some of my “links” have disappeared. And I get the following error when I try to save. They are not the same links, that I lost on import and these related to the error on save. Any ideas what can be wrong?

insert into "public"."recipes_diets_links" ("diet_id", "diet_order", "recipe_id") values ($1, $2, $3), ($4, $5, $6), ($7, $8, $9), ($10, $11, $12), ($13, $14, $15), ($16, $17, $18), ($19, $20, $21), ($22, $23, $24), ($25, $26, $27), ($28, $29, $30), ($31, $32, $33), ($34, $35, $36) on conflict ("recipe_id", "diet_id") do update set "diet_order" = excluded."diet_order" returning "id" - insert or update on table "recipes_diets_links" violates foreign key constraint "recipes_diets_links_inv_fk"

error: insert into "public"."recipes_diets_links" ("diet_id", "diet_order", "recipe_id") values ($1, $2, $3), ($4, $5, $6), ($7, $8, $9), ($10, $11, $12), ($13, $14, $15), ($16, $17, $18), ($19, $20, $21), ($22, $23, $24), ($25, $26, $27), ($28, $29, $30), ($31, $32, $33), ($34, $35, $36) on conflict ("recipe_id", "diet_id") do update set "diet_order" = excluded."diet_order" returning "id" - insert or update on table "recipes_diets_links" violates foreign key constraint "recipes_diets_links_inv_fk"

at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)

at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)

at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)

at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)

at Socket.emit (node:events:513:28)

at Socket.emit (node:domain:489:12)

at addChunk (node:internal/streams/readable:315:12)

at readableAddChunk (node:internal/streams/readable:289:9)

at Socket.Readable.push (node:internal/streams/readable:228:10)

at TCP.onStreamRead (node:internal/stream_base_commons:190:23)