Fix retention query performance and cleanup scheduling

This commit is contained in:
2026-10-06 10:39:32 -04:00
parent 9fd448339d
commit 88a950692a
8 changed files with 104 additions and 8 deletions
+2
View File
@@ -522,6 +522,7 @@ CREATE TABLE IF NOT EXISTS provisioning_sources (
server TEXT NOT NULL,
PRIMARY KEY (operation_id, kind, source_id, server)
);
CREATE INDEX IF NOT EXISTS idx_provisioning_sources_source ON provisioning_sources(kind, source_id);
-- Blueprints retain map/count selections only. The legacy column name remains
-- compatible with older snapshot-based definitions, read as selections at runtime.
@@ -732,6 +733,7 @@ CREATE TABLE IF NOT EXISTS watchdog_actions (
cycle INTEGER NOT NULL DEFAULT 1,
UNIQUE(incident_id,cycle,action)
);
CREATE INDEX IF NOT EXISTS idx_watchdog_actions_campaign ON watchdog_actions(campaign_id);
-- Explicit history holds and failure resolution never bypass dependency checks.
CREATE TABLE IF NOT EXISTS retention_controls (