{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": ".\/venv\/bin\/python -c \"\nimport mysql.connector\nfrom config import DB_CONFIG\n\nconn = mysql.connector.connect(**DB_CONFIG)\ncursor = conn.cursor()\n\n# Disable FK checks\ncursor.execute('SET FOREIGN_KEY_CHECKS = 0')\n\n# Clear entity tables\ntables = ['entity_classifications', 'entity_synonyms', 'entity_semantics', \n 'entity_ontology', 'entity_taxonomy_mapping', 'entity_relations', 'entities']\nfor t in tables:\n try:\n cursor.execute(f'TRUNCATE TABLE {t}')\n print(f'Cleared {t}')\n except Exception as e:\n print(f'Failed {t}: {e}')\n\n# Re-enable FK checks\ncursor.execute('SET FOREIGN_KEY_CHECKS = 1')\nconn.commit()\ncursor.close()\nconn.close()\nprint('Done')\n\"",
"description": "Clear entity tables with FK checks disabled"
}
}
{
"tool_response": {
"stdout": "Cleared entity_classifications\nCleared entity_synonyms\nCleared entity_semantics\nCleared entity_ontology\nCleared entity_taxonomy_mapping\nCleared entity_relations\nCleared entities\nDone",
"stderr": "",
"interrupted": false,
"isImage": false
}
}