-- =====================================================
-- Migration: Add Paused Status to Scheduled Notifications
-- Date: February 22, 2026
-- Description: Adds 'paused' status enum value to scheduled_notifications table
-- =====================================================

USE aayusha_backend;

-- Add 'paused' to status enum if it doesn't exist
ALTER TABLE `scheduled_notifications` 
MODIFY COLUMN `status` ENUM('pending', 'sent', 'failed', 'cancelled', 'paused') DEFAULT 'pending';

-- Verify the change
SELECT COLUMN_TYPE 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_SCHEMA = 'aayusha_backend' 
  AND TABLE_NAME = 'scheduled_notifications' 
  AND COLUMN_NAME = 'status';

-- Expected output should show:
-- enum('pending','sent','failed','cancelled','paused')

SELECT 
    CONCAT('✓ Migration completed successfully. Status enum now includes: ', 
    COLUMN_TYPE) as result
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_SCHEMA = 'aayusha_backend' 
  AND TABLE_NAME = 'scheduled_notifications' 
  AND COLUMN_NAME = 'status';
