summaryrefslogtreecommitdiff
path: root/makima/migrations/20250121000000_add_is_anonymous.sql
blob: 084fc2d53a0f8939704525e2b080c2e7d43b6790 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
-- Add is_anonymous column to tasks table for ephemeral task support
-- Anonymous tasks don't belong to contracts and are automatically cleaned up after completion

ALTER TABLE tasks ADD COLUMN IF NOT EXISTS is_anonymous BOOLEAN NOT NULL DEFAULT FALSE;

-- Index for efficient cleanup queries (anonymous tasks that are completed)
CREATE INDEX IF NOT EXISTS idx_tasks_anonymous_cleanup
    ON tasks(is_anonymous, status, completed_at)
    WHERE is_anonymous = TRUE;

COMMENT ON COLUMN tasks.is_anonymous IS 'True for ephemeral one-off tasks that are not part of a contract and will be auto-cleaned up';