CREATE TABLE notifications (
    id CHAR(36) PRIMARY KEY,
    user_id CHAR(36) NOT NULL,
    type ENUM('order_status', 'new_order', 'payment_proof', 'service_request', 'consultation_request', 'training_update') NOT NULL,
    message TEXT NOT NULL,
    related_entity_type VARCHAR(100) DEFAULT NULL,
    related_entity_id CHAR(36) DEFAULT NULL,
    is_read BOOLEAN DEFAULT FALSE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    INDEX idx_user_id (user_id),
    INDEX idx_is_read (is_read),
    INDEX idx_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
