- Add comment edit/delete functionality (owner or admin can modify) - Add edit/delete buttons to comments in TicketView - Create update_comment.php and delete_comment.php API endpoints - Add updateComment() and deleteComment() methods to CommentModel - Show "(edited)" indicator on modified comments - Add migration script for updated_at column - Auto-link URLs in plain text comments (non-markdown) - Add markdown table support with proper HTML rendering - Preserve code blocks during markdown parsing - Fix mobile UI elements showing on desktop (add display:none defaults) - Add mobile styles for CreateTicketView form elements - Stack status-priority-row on mobile devices - Update cache busters to v20260124e - Update Claude.md and README.md documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Migration script to add updated_at column to ticket_comments table
|
|
* Run this on the production server: php scripts/add_comment_updated_at.php
|
|
*/
|
|
|
|
require_once dirname(__DIR__) . '/config/config.php';
|
|
|
|
echo "Adding updated_at column to ticket_comments table...\n";
|
|
|
|
try {
|
|
$conn = new mysqli(
|
|
$GLOBALS['config']['DB_HOST'],
|
|
$GLOBALS['config']['DB_USER'],
|
|
$GLOBALS['config']['DB_PASS'],
|
|
$GLOBALS['config']['DB_NAME']
|
|
);
|
|
|
|
if ($conn->connect_error) {
|
|
throw new Exception("Connection failed: " . $conn->connect_error);
|
|
}
|
|
|
|
// Check if column already exists
|
|
$result = $conn->query("SHOW COLUMNS FROM ticket_comments LIKE 'updated_at'");
|
|
|
|
if ($result->num_rows > 0) {
|
|
echo "Column 'updated_at' already exists in ticket_comments table.\n";
|
|
} else {
|
|
// Add the column
|
|
$sql = "ALTER TABLE ticket_comments ADD COLUMN updated_at TIMESTAMP NULL DEFAULT NULL AFTER created_at";
|
|
|
|
if ($conn->query($sql)) {
|
|
echo "Successfully added 'updated_at' column to ticket_comments table.\n";
|
|
} else {
|
|
throw new Exception("Failed to add column: " . $conn->error);
|
|
}
|
|
}
|
|
|
|
$conn->close();
|
|
echo "Done!\n";
|
|
|
|
} catch (Exception $e) {
|
|
echo "Error: " . $e->getMessage() . "\n";
|
|
exit(1);
|
|
}
|