-- Drop the existing CHECK constraint on notifications.type and replace with an expanded one
ALTER TABLE notifications
    DROP CONSTRAINT IF EXISTS notifications_type_check;

ALTER TABLE notifications
    ADD CONSTRAINT notifications_type_check CHECK (
        type IN (
            'course_enrolled',
            'lesson_completed',
            'assessment_assigned',
            'assessment_submitted',
            'assessment_graded',
            'course_completed',
            'certificate_issued',
            'announcement',
            'otp_sent',
            'signup_welcome',
            'system_alert',
            'knowledge_level_update',
            'payment_verified',
            'subscription_activated',
            'course_created',
            'sub_course_created',
            'video_added',
            'issue_status_updated',
            'issue_created',
            'admin_created',
            'team_member_created',
            'user_deleted'
        )
    );
