diff --git a/apps/coder/src/schema.sql b/apps/coder/src/schema.sql index 58b9e66..1e49f00 100644 --- a/apps/coder/src/schema.sql +++ b/apps/coder/src/schema.sql @@ -75,8 +75,14 @@ ALTER TABLE tasks ADD COLUMN IF NOT EXISTS mode_id TEXT; ALTER TABLE tasks ADD COLUMN IF NOT EXISTS thinking_option_id TEXT; -- tasks.feature_values and tasks.worktree_path were never read or written by any -- code path; drop them from existing DBs (fresh DBs never had them in the CREATE). +-- human_inbox is `SELECT *` over tasks, so it pins every task column — dropping a +-- column while the view exists fails (2BP01). Drop the view, drop the columns, then +-- recreate it with the current column set (idempotent on fresh + existing DBs). +DROP VIEW IF EXISTS human_inbox; ALTER TABLE tasks DROP COLUMN IF EXISTS feature_values; ALTER TABLE tasks DROP COLUMN IF EXISTS worktree_path; +CREATE OR REPLACE VIEW human_inbox AS + SELECT * FROM tasks WHERE state IN ('blocked', 'failed'); -- v2.6: one backend session per (session, agent); resumed on switch-back. CREATE TABLE IF NOT EXISTS agent_sessions (