HEX
Server: Apache
System: Linux 136-243-153-58.cprapid.com 4.18.0-553.81.1.el8_10.x86_64 #1 SMP Mon Oct 27 11:29:19 EDT 2025 x86_64
User: mytest (1001)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mytest/.trash/GUEST_DOCUMENTS_FIX.sql.33
-- ========================================
-- FIX: Guest Documents Table - Add Missing Columns
-- Run this SQL in phpMyAdmin to fix guest document uploads
-- ========================================

-- Add missing columns to guest_documents table
ALTER TABLE `guest_documents` 
ADD COLUMN `original_filename` VARCHAR(255) AFTER `document_type`,
ADD COLUMN `stored_filename` VARCHAR(255) AFTER `original_filename`,
ADD COLUMN `mime_type` VARCHAR(100) AFTER `stored_filename`,
ADD COLUMN `size_bytes` INT AFTER `mime_type`;

-- Rename file_path column (it's not being used, stored_filename is used instead)
-- Keep it for backwards compatibility but make it nullable
ALTER TABLE `guest_documents` 
MODIFY COLUMN `file_path` VARCHAR(500) NULL;

-- Add indexes for better performance
ALTER TABLE `guest_documents`
ADD INDEX `idx_document_type` (`document_type`),
ADD INDEX `idx_uploaded_at` (`uploaded_at`);

-- Verify the changes
DESCRIBE `guest_documents`;