Issue with Comments Panel and Deletion of User Account

Im having an issue with the deletion of a user account. Because I am using the comments panel throughout my project the user ID is tied into them. When I go to delete an account I get the following message

What is the best way to go about rectifiying this? Currently the only solution that works is deleting all of the comments by this user, which is not feasible

By default there are three tables associated with the Comments Panel:

notes
itemNotes
users

Deleting a row from the users table will require you to also delete any reference to that user in the other two tables.

I’m not sure why a simple query to delete all comments by a user is not feasible, but I’m sure you have your reasons. You have a couple of options that I can think of, but both of them require that you move away from the default tables for the component.

  • Add a column to the users table which denotes the user account as ‘enabled/disabled’ and instead of deleting the user, just disable the account.

  • Use only one database table for the comments panel, then their will be no foreign key constraints.

Perhaps someone else has some better ideas on how to overcome this particular hurdle but that’s all I can think of.