745cdd79cf
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>
15 lines
594 B
SQL
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';
|