Unable to create schema due to database issue

System Information
  • Strapi Version: 4.9.2
  • Operating System: Mac
  • Database: Postgres
  • Node Version: 16
  • NPM Version:
  • Yarn Version:

After adding items to a schema using content type builder and save changes, I received this error.

alter table "files_related_morphs" add constraint "files_related_morphs_fk" foreign key ("file_id") references "files" ("id") on delete CASCADE - insert or update on table "files_related_morphs" violates foreign key constraint "files_related_morphs_fk" error: alter table "files_related_morphs" add constraint "files_related_morphs_fk" foreign key ("file_id") references "files" ("id") on delete CASCADE - insert or update on table "files_related_morphs" violates foreign key constraint "files_related_morphs_fk"

I am not sure how to fix this issue. Also, when performing pg_dump, I always receive this warning warning: there are circular foreign-key constraints on this table: any tips on clearing this?

Thank you


Looks to be a corruption in your data.

It may be worth jumping into open office hours 6.30GMT on Discord Monday - Friday

Noted. I will give it a try. Thanks!