Files
fn_registry/fn_operations/migrations/003_logs.sql
T
egutierrez 615f279323 feat: modelo Log y CRUD en fn_operations
Tipo Log con niveles debug/info/warn/error, source, entity_id y execution_id
opcionales. Migración 003_logs.sql y funciones InsertLog, GetLog, ListLogs
con filtros combinables.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:31:03 +02:00

15 lines
511 B
SQL

CREATE TABLE logs (
id TEXT PRIMARY KEY,
level TEXT NOT NULL DEFAULT 'info' CHECK(level IN ('debug','info','warn','error')),
source TEXT NOT NULL DEFAULT '',
entity_id TEXT NOT NULL DEFAULT '',
execution_id TEXT NOT NULL DEFAULT '',
message TEXT NOT NULL,
metadata TEXT NOT NULL DEFAULT '{}',
created_at TEXT NOT NULL
);
CREATE INDEX idx_logs_level ON logs(level);
CREATE INDEX idx_logs_source ON logs(source);
CREATE INDEX idx_logs_created_at ON logs(created_at);