Files
OmniRoute/src/lib/db/migrations/161_config_audit_log.sql
Dizzle 84c9dfdd2c fix(config-audit): persist config audit log to SQLite with retention (#11103)
Validated on the combined batch board over release/v3.8.50 tip d91238b7: static gates clean, typecheck:core clean, focused tests green.

Config-audit survives restarts with bounded growth (migration 161 + OR IGNORE seed, retention wired into runAutoCleanup); route cabling deliberately out of scope. Thank you @maxmad64bis!
2026-08-22 14:40:09 -03:00

16 lines
496 B
SQL

CREATE TABLE IF NOT EXISTS config_audit_log (
id TEXT PRIMARY KEY,
timestamp TEXT NOT NULL,
action TEXT NOT NULL,
target TEXT NOT NULL,
target_id TEXT NOT NULL,
target_name TEXT NOT NULL,
before_json TEXT,
after_json TEXT,
diff_json TEXT NOT NULL,
source TEXT NOT NULL,
note TEXT
);
CREATE INDEX IF NOT EXISTS idx_config_audit_log_target_created ON config_audit_log(target, timestamp);
CREATE INDEX IF NOT EXISTS idx_config_audit_log_created ON config_audit_log(timestamp);