feat(ops): add api key filter to system logs

This commit is contained in:
Bestony
2026-06-27 14:35:19 +08:00
parent c275422251
commit bad87ff533
15 changed files with 134 additions and 5 deletions
@@ -0,0 +1,5 @@
-- 154_add_ops_system_logs_api_key_id.sql
-- Persist API key database id as a queryable system log index column.
ALTER TABLE ops_system_logs
ADD COLUMN IF NOT EXISTS api_key_id BIGINT;
@@ -0,0 +1,5 @@
-- 155_add_ops_system_logs_api_key_id_index_notx.sql
-- Non-transactional migration: CREATE INDEX CONCURRENTLY cannot run in a transaction.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_ops_system_logs_api_key_id_created_at
ON ops_system_logs (api_key_id, created_at DESC);