Hi,
We have run into an issue with 5.2.x whereby we can’t delete a User due to the following error:
Reference error
The record(s) are referenced by other records, please remove all the references first.
ERROR: update or delete on table “auth_user” violates foreign key constraint “fk_cd7rbh06u655vqmeaguaihof4” on table “meta_view_custom”
Detail: Key (id)=(5) is still referenced from table “meta_view_custom”.
We are getting the same error on multiple installs.
Yes, that is a common message. In fact you are trying to delete a record that is referenced somewhere else in another record. For example, a user is referenced as creator of on invoice.
In the context of relational databases, it requires that if a value of one attribute (column) of a relation (table) references a value of another attribute (either in the same or a different relation), then the referenced value must exist.
So here if you tried to remove a user that is referenced as the creator of an invoice, the delete statement will failed. That’s why there is that error message generated by the database.
In your specific case, the user is references in meta_view_custom table which stored all the personalized views when a user drag/drop panels on dashboard.