miroir/crates/miroir-core/migrations/006_ttl_policy.sql
jedarden 620424a21a feat(admin-api): add TTL policy endpoint (plan §13.14)
Implements POST/GET/DELETE /_miroir/indexes/{uid}/ttl-policy and
GET /_miroir/ttl-policies for per-index TTL sweep policy configuration.

Adds:
- Task store table 16 (ttl_policy) with SQLite and Redis backends
- Migration 006_ttl_policy.sql
- Endpoint handlers for CRUD operations on TTL policies

Accepts: {sweep_interval_s, max_deletes_per_sweep, enabled} to override
global ttl.* settings per index.

Closes: bf-2pgb4

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 15:40:45 -04:00

12 lines
409 B
SQL

-- Migration 006: TTL policy table (plan §13.14)
-- Adds per-index TTL sweep policy configuration
-- Allows operators to override global TTL settings per index
-- Create ttl_policy table
CREATE TABLE IF NOT EXISTS ttl_policy (
index_uid TEXT PRIMARY KEY,
sweep_interval_s INTEGER NOT NULL,
max_deletes_per_sweep INTEGER NOT NULL,
enabled INTEGER NOT NULL,
updated_at INTEGER NOT NULL
);