Files
geo/server/migrations/20260503110000_add_generation_task_leases.up.sql
T
root 745cdd79cf feat(compliance): add content compliance detection across tenant, ops, and clients
Implements the Revision 8/9 compliance design: tenant + ops backends, ops-web
content-safety pages, admin-web editor/publish gate integration, desktop publish
block surfacing, and supporting migrations / shared types / config plumbing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 20:48:14 +08:00

15 lines
594 B
SQL

ALTER TABLE generation_tasks
ADD COLUMN IF NOT EXISTS lease_token VARCHAR(64),
ADD COLUMN IF NOT EXISTS lease_owner VARCHAR(128),
ADD COLUMN IF NOT EXISTS lease_expires_at TIMESTAMPTZ,
ADD COLUMN IF NOT EXISTS attempt_count INT NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS last_heartbeat_at TIMESTAMPTZ;
CREATE INDEX IF NOT EXISTS idx_generation_tasks_running_lease
ON generation_tasks(lease_expires_at, id)
WHERE status = 'running';
CREATE INDEX IF NOT EXISTS idx_generation_tasks_queued_stale
ON generation_tasks(updated_at, id)
WHERE status = 'queued';