Adds
statusandstatus_updated_atcolumns to thethoughtstable for kanban-style workflow management of tasks and ideas.
Extends the thoughts table with two columns that track workflow state. This enables the Workflow board in the Next.js dashboard and the progress_task MCP tool for AI-assisted task management.
Valid statuses: new, planning, active, review, done, archived
Only task and idea thought types use the status field. All other types have status = NULL.
- Working Open Brain setup (guide)
- Access to the Supabase SQL Editor or CLI
WORKFLOW STATUS -- CREDENTIAL TRACKER
--------------------------------------
SUPABASE (from your Open Brain setup)
Project URL: ____________
Secret key: ____________
--------------------------------------
- Open your Supabase SQL Editor (Dashboard > SQL Editor)
- Paste and run the migration:
SQL: Add status columns and backfill existing tasks/ideas
-- Add status column (nullable — only task/idea types use it)
ALTER TABLE thoughts ADD COLUMN IF NOT EXISTS status TEXT DEFAULT NULL;
-- Add timestamp for tracking when status last changed
ALTER TABLE thoughts ADD COLUMN IF NOT EXISTS status_updated_at TIMESTAMPTZ DEFAULT now();
-- Index for fast status filtering (partial — only rows with a status)
CREATE INDEX IF NOT EXISTS idx_thoughts_status ON thoughts (status) WHERE status IS NOT NULL;
-- Backfill: set existing task and idea thoughts to 'new' status
UPDATE thoughts
SET status = 'new', status_updated_at = now()
WHERE type IN ('task', 'idea') AND status IS NULL;Or via the Supabase CLI:
supabase db push(if you have the migration file in supabase/migrations/)
-
Verify the columns exist:
SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'thoughts' AND column_name IN ('status', 'status_updated_at');
-
Verify the backfill worked:
SELECT status, count(*) FROM thoughts WHERE type IN ('task', 'idea') GROUP BY status;
After running the migration:
- The
thoughtstable has two new columns:status(TEXT, nullable) andstatus_updated_at(TIMESTAMPTZ) - All existing
taskandideathoughts havestatus = 'new' - A partial index
idx_thoughts_statusexists for fast status queries - Other thought types (
observation,reference, etc.) havestatus = NULLand are unaffected
Tip
The migration is idempotent — safe to run multiple times. IF NOT EXISTS prevents duplicate columns or indexes.
Once the schema is applied, update your open-brain-mcp Edge Function to include the progress_task tool. This allows AI assistants to manage task status conversationally:
| Tool | Parameters | Description |
|---|---|---|
progress_task |
thought_id (required), status, importance |
Update workflow status or priority of a task/idea |
Example prompts after setup:
- "Move thought 42 to active"
- "Set the priority on the API redesign to high"
- "Mark the karaoke task as done"
Issue: "column already exists" error
Solution: This is expected if you run the migration twice. The IF NOT EXISTS clause handles this — the error is informational only.
Issue: Existing tasks don't appear on the Workflow board
Solution: Run the backfill query manually: UPDATE thoughts SET status = 'new' WHERE type IN ('task', 'idea') AND status IS NULL;
Issue: Non-task thoughts showing status values
Solution: The status column should only be set for task and idea types. Run: UPDATE thoughts SET status = NULL WHERE type NOT IN ('task', 'idea');