-- 2) Model mapping fields (analogous to usage_logs.requested_model / upstream_model)
ALTERTABLEops_error_logs
ADDCOLUMNIFNOTEXISTSrequested_modelVARCHAR(100),
ADDCOLUMNIFNOTEXISTSupstream_modelVARCHAR(100);
-- 3) Granular request type enum (analogous to usage_logs.request_type: 0=unknown, 1=sync, 2=stream, 3=ws_v2)
ALTERTABLEops_error_logs
ADDCOLUMNIFNOTEXISTSrequest_typeSMALLINT;
COMMENTONCOLUMNops_error_logs.inbound_endpointIS'Normalized client-facing API endpoint path, e.g. /v1/chat/completions. Populated from InboundEndpointMiddleware.';
COMMENTONCOLUMNops_error_logs.upstream_endpointIS'Normalized upstream endpoint path derived from platform, e.g. /v1/responses.';
COMMENTONCOLUMNops_error_logs.requested_modelIS'Client-requested model name before mapping (raw from request body).';
COMMENTONCOLUMNops_error_logs.upstream_modelIS'Actual model sent to upstream provider after mapping. NULL means no mapping applied.';
COMMENTONCOLUMNops_error_logs.request_typeIS'Request type enum: 0=unknown, 1=sync, 2=stream, 3=ws_v2. Matches usage_logs.request_type semantics.';