2026.10.0 — Log Table ALTER Scripts
This page is unlisted — it is not linked from the sidebar or search, and is intended to be reached only via a direct link from the 2026.10.0 release notes and the AI routing page.
Who needs this
This script is only relevant if your Apinizer installation writes API proxy traffic logs to a relational database via the SQL/JDBC traffic-log connector (Oracle, MySQL, PostgreSQL, or SQL Server).
If you use the Elasticsearch or MongoDB connector, skip this page entirely — those targets carry the new data without any manual step. On Elasticsearch the index template is updated and the index is rolled over automatically during the upgrade.
What changed
Apinizer 2026.10.0 adds the LLM route classifier to AI routing. The traffic log records the classifier decision for every request that evaluated a classifier route. This script is required also when you do not use the LLM classifier. The gateway INSERT names all columns of the table, so the columns must exist whether or not you use the classifier.
log_ApiProxyTraffic gains six columns:
ai_route_cls_label— the label the classifier picked.ai_route_cls_outcome— the outcome of the classifier decision.ai_route_cls_latency_ms— the classifier decision time in milliseconds.ai_route_cls_token_in— the input tokens the classifier used.ai_route_cls_token_out— the output tokens the classifier used.ai_route_cls_cost_micro— the classifier cost in micro-USD.
All six columns are nullable and sparse. They stay NULL for traffic that did not evaluate a classifier route. Existing rows stay NULL.
The gateway INSERT names every column of log_ApiProxyTraffic. If these six columns are missing, every traffic-log insert to this database fails and the traffic records are lost. Run the script before you upgrade the gateway to 2026.10.0.
When to run it
Run this once, against each configured SQL/JDBC traffic-log database, before you upgrade the gateway to 2026.10.0. It does not need to be run inside a maintenance window. Because the columns are nullable, older gateway workers that still write pre-upgrade log rows are unaffected. Test in a non-production environment first if you use a change-control process for DDL.
This script is independent of the earlier ALTER scripts. If you upgrade from an older version, also run the earlier scripts for your starting version (see the column-count table on Apinizer Log Table Creation Commands).
The 2026.09.8 build already contains the INSERT for these six columns. If your installation runs 2026.09.8 and the table already has 140 columns, do not run this script again. Adding a column that already exists raises an error.
If you create the table from the CREATE TABLE statements on the Apinizer Log Table Creation Commands page of 2026.10.0, the table already has these columns and you do not run this script.
Oracle
ALTER TABLE log_ApiProxyTraffic ADD (
ai_route_cls_label VARCHAR2(64),
ai_route_cls_outcome VARCHAR2(16),
ai_route_cls_latency_ms NUMBER(19),
ai_route_cls_token_in NUMBER(19),
ai_route_cls_token_out NUMBER(19),
ai_route_cls_cost_micro NUMBER(19)
);
PostgreSQL
ALTER TABLE log_ApiProxyTraffic
ADD COLUMN ai_route_cls_label VARCHAR(64),
ADD COLUMN ai_route_cls_outcome VARCHAR(16),
ADD COLUMN ai_route_cls_latency_ms BIGINT,
ADD COLUMN ai_route_cls_token_in BIGINT,
ADD COLUMN ai_route_cls_token_out BIGINT,
ADD COLUMN ai_route_cls_cost_micro BIGINT;
MySQL
ALTER TABLE log_ApiProxyTraffic
ADD COLUMN ai_route_cls_label VARCHAR(64),
ADD COLUMN ai_route_cls_outcome VARCHAR(16),
ADD COLUMN ai_route_cls_latency_ms BIGINT,
ADD COLUMN ai_route_cls_token_in BIGINT,
ADD COLUMN ai_route_cls_token_out BIGINT,
ADD COLUMN ai_route_cls_cost_micro BIGINT;
SQL Server
ALTER TABLE log_ApiProxyTraffic ADD
ai_route_cls_label NVARCHAR(64),
ai_route_cls_outcome NVARCHAR(16),
ai_route_cls_latency_ms BIGINT,
ai_route_cls_token_in BIGINT,
ai_route_cls_token_out BIGINT,
ai_route_cls_cost_micro BIGINT;
Verification
After running the script, confirm the column count on log_ApiProxyTraffic increased by 6. For example, on PostgreSQL, MySQL, or SQL Server:
SELECT COUNT(*) FROM information_schema.columns WHERE LOWER(table_name) = 'log_apiproxytraffic';
On Oracle, count the columns in USER_TAB_COLUMNS for LOG_APIPROXYTRAFFIC. Then send a request through an AI API Proxy that has a classifier route and check the new columns:
SELECT correlation_id, ai_route_cls_label, ai_route_cls_outcome, ai_route_cls_latency_ms
FROM log_ApiProxyTraffic
WHERE ai_route_cls_label IS NOT NULL
ORDER BY log_timestamp DESC;