Files
geo/server/migrations/20260526110000_add_publish_task_dedup_index.up.sql
T

9 lines
481 B
SQL
Raw Normal View History

-- Keep succeeded publish tasks in the active dedup set intentionally: the
-- product rule is "one article can be published to an account once"; repeat
-- publishing should use a copied/new article or an explicit admin status reset.
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS uq_desktop_tasks_publish_dedup_active
ON desktop_tasks (dedup_key)
WHERE kind = 'publish'
AND dedup_key IS NOT NULL
AND status IN ('queued', 'in_progress', 'succeeded', 'unknown');