{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "cd \/var\/www\/scripts\/pipeline && DB_PASSWORD=\"v8mFLmkF2fth_r\" .\/venv\/bin\/python -c \"\nimport pymysql\nimport os\n\npassword = os.getenv('DB_PASSWORD')\nconn = pymysql.connect(\n host='localhost',\n user='root',\n password=password,\n database='ki_content',\n cursorclass=pymysql.cursors.DictCursor\n)\n\ncursor = conn.cursor()\n\n# Check current columns\ncursor.execute('DESCRIBE content_orders')\ncolumns = [row['Field'] for row in cursor.fetchall()]\nprint('Aktuelle Spalten:', columns)\n\n# Add new columns if not exist\nalterations = []\n\nif 'temperature' not in columns:\n alterations.append('ADD COLUMN temperature DECIMAL(3,2) DEFAULT 0.50')\n \nif 'max_tokens' not in columns:\n alterations.append('ADD COLUMN max_tokens INT DEFAULT 4096')\n \nif 'system_prompt_id' not in columns:\n alterations.append('ADD COLUMN system_prompt_id INT NULL')\n \nif 'selected_critics' not in columns:\n alterations.append('ADD COLUMN selected_critics JSON NULL')\n \nif 'quality_check' not in columns:\n alterations.append('ADD COLUMN quality_check TINYINT(1) DEFAULT 0')\n\nif alterations:\n sql = 'ALTER TABLE content_orders ' + ', '.join(alterations)\n print(f'Executing: {sql}')\n cursor.execute(sql)\n conn.commit()\n print(f'{len(alterations)} Spalten hinzugefügt')\nelse:\n print('Alle Spalten bereits vorhanden')\n\ncursor.close()\nconn.close()\n\"",
"description": "Add new columns to content_orders"
}
}
{
"tool_response": {
"stdout": "Aktuelle Spalten: ['id', 'title', 'briefing', 'author_profile_id', 'contract_id', 'structure_id', 'model', 'collections', 'context_limit', 'status', 'generation_status', 'generation_started_at', 'generation_error', 'generation_log', 'generation_step', 'critique_status', 'critique_started_at', 'critique_error', 'critique_log', 'critique_step', 'current_critique_round', 'created_by', 'created_at', 'updated_at']\nExecuting: ALTER TABLE content_orders ADD COLUMN temperature DECIMAL(3,2) DEFAULT 0.50, ADD COLUMN max_tokens INT DEFAULT 4096, ADD COLUMN system_prompt_id INT NULL, ADD COLUMN selected_critics JSON NULL, ADD COLUMN quality_check TINYINT(1) DEFAULT 0\n5 Spalten hinzugefügt",
"stderr": "",
"interrupted": false,
"isImage": false
}
}