-- Audit of notification broadcast sends: one row per user send attempt.
CREATE TABLE notifications_audit (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    user_id INT NOT NULL COMMENT 'Internal user id from db_users_a',
    status VARCHAR(20) NOT NULL COMMENT 'SUCCESS or FAILED',
    telegram_status_code INT NULL COMMENT 'HTTP status from Telegram API response (e.g. 200, 403)',
    created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
    INDEX idx_notifications_audit_user_id (user_id),
    INDEX idx_notifications_audit_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
