-- =========================================
-- NOTIFICATIONS TABLE
-- =========================================
CREATE TABLE IF NOT EXISTS notifications (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_type ENUM('admin', 'user') NOT NULL,
    type VARCHAR(50) NOT NULL, -- 'appointment', 'contact', 'appointment_status'
    title VARCHAR(255) NOT NULL,
    message TEXT,
    data JSON, -- Store related data (appointment_id, contact_id, etc.)
    is_read BOOLEAN DEFAULT FALSE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    INDEX idx_user_type (user_type),
    INDEX idx_is_read (is_read),
    INDEX idx_created_at (created_at)
);

