feat(db): add requested model usage log migrations
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
3
backend/migrations/077_add_usage_log_requested_model.sql
Normal file
3
backend/migrations/077_add_usage_log_requested_model.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Add requested_model field to usage_logs for normalized request/upstream model tracking.
|
||||
-- NULL means historical rows written before requested_model dual-write was introduced.
|
||||
ALTER TABLE usage_logs ADD COLUMN IF NOT EXISTS requested_model VARCHAR(100);
|
||||
@@ -0,0 +1,3 @@
|
||||
-- Support requested_model / upstream_model aggregations with time-range filters.
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_usage_logs_created_requested_model_upstream_model
|
||||
ON usage_logs (created_at, requested_model, upstream_model);
|
||||
Reference in New Issue
Block a user