query("SHOW COLUMNS FROM `sales_tenant_consultations`")->fetchAll(PDO::FETCH_COLUMN); echo "Columns: " . implode(", ", $columns) . "\n"; if (!in_array('audio_file_path', $columns)) { $pdo->exec("ALTER TABLE `sales_tenant_consultations` ADD COLUMN `audio_file_path` varchar(500) DEFAULT NULL AFTER `log_text` "); echo "Added audio_file_path\n"; } if (!in_array('attachment_paths', $columns)) { $pdo->exec("ALTER TABLE `sales_tenant_consultations` ADD COLUMN `attachment_paths` text DEFAULT NULL AFTER `audio_file_path` "); echo "Added attachment_paths\n"; } if (!in_array('consultation_type', $columns)) { $pdo->exec("ALTER TABLE `sales_tenant_consultations` ADD COLUMN `consultation_type` varchar(20) DEFAULT 'text' AFTER `attachment_paths` "); echo "Added consultation_type\n"; } echo "Schema check completed.\n"; } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; }