I need to manually delete a group that is corrupt. Already tried a few things. This corrupt group assigned itself as the parent to other groups and continues to add additional children groups every time 'managed groups' is open. I tried to delete the group via civicrm ui and directly in the db but then unable to edit any records or import records. Error message is below.
I also manually removed parent child relationships directly in the database and then disabled the corrupt group in civicrm. This disabled all the group that were just removed as children.
Also, cannot delete records from the group. And the number of records in this group changes every time 'managed group' is opened. Obviously corrupt and needs to be deleted. Any info on the data schema for groups and parent groups appreciated.
Here is the error when this corrupt group is deleted:
$Fatal Error Details = Array ( [callback] => Array (  => CRM_Core_Error  => handle )
[code] => -3 [message] => DB Error: constraint violation [mode] => 16 [debug_info] => REPLACE INTO civicrm_group_contact ( group_id, contact_id, status ) VALUES ( 58, 39435, 'Added' ) [nativecode=1452 **
Cannot add or update a child row: a foreign key constraint fails (
FK_civicrm_group_contact_group_idFOREIGN KEY (
id) ON DELETE CASCADE)]