-- Migration: Add file support to messages table
-- Run this if your messages table doesn't have file_type, file_url, file_name columns

ALTER TABLE `messages` 
ADD COLUMN IF NOT EXISTS `file_type` ENUM('text','image','video') DEFAULT 'text' AFTER `message`,
ADD COLUMN IF NOT EXISTS `file_url` VARCHAR(255) DEFAULT NULL AFTER `file_type`,
ADD COLUMN IF NOT EXISTS `file_name` VARCHAR(255) DEFAULT NULL AFTER `file_url`;

-- Note: If your MySQL version doesn't support IF NOT EXISTS, use this instead:
-- ALTER TABLE `messages` ADD COLUMN `file_type` ENUM('text','image','video') DEFAULT 'text' AFTER `message`;
-- ALTER TABLE `messages` ADD COLUMN `file_url` VARCHAR(255) DEFAULT NULL AFTER `file_type`;
-- ALTER TABLE `messages` ADD COLUMN `file_name` VARCHAR(255) DEFAULT NULL AFTER `file_url`;

