Skip to Content
Menu
This question has been flagged
1 Reply
343 Views

 I have accessed my educational enterprise database as a student, imported some data, and later deleted certain records. However, when attempting to download demo data into my database, I encountered the following validation error:

 

Validation Error


The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead.


Model: Unknown (unknown)

Constraint: product_document_sale_pdf_form_field_r_product_document_id_fkey


Avatar
Discard
Best Answer

Hi
Constraints are database rules that can apply to different fields.
In this situation, it seems that there is a conflicting id in the database, that doesn't allow for the new record to be created.

You can try to look up by the name of the field, to try to find out what object or objects should be deleted, in order to use it on your local database.

If you use PgAdmin, you can search by the key name to find where it's defined, and discover the models relation established by that key, to find the conflicting objects. But this can lead you into a rabbit hole, as there might be more conflicts in the future.

My advice is to create a clone of the edu database, and use it to create a new local instance, which will give you a clean installation with all of the information you already have in the other database.

Avatar
Discard