-- Add password reset fields to job_portal_users table
-- GHAMECC Job Portal - Password Reset Feature

-- Add reset token and expiry fields
ALTER TABLE `job_portal_users` 
ADD COLUMN IF NOT EXISTS `reset_token` varchar(64) DEFAULT NULL,
ADD COLUMN IF NOT EXISTS `reset_token_expiry` datetime DEFAULT NULL,
ADD INDEX IF NOT EXISTS `idx_reset_token` (`reset_token`);

-- Update the updated_at column to have proper default and on update
ALTER TABLE `job_portal_users` 
MODIFY COLUMN `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
