Files
multica/server/migrations/376_agent_task_durable_work_dir.up.sql
18f130a5d9 fix(migrate): restore unique migration prefixes after the 362 collision (#7319)
#7176 and #7182 both took prefix 362 before either merged, and the
uniqueness lint was silenced by adding 362 to the historical
duplicate-prefix exception list. Neither migration has shipped in a
release, so the collision is still fixable.

Renumber the later of the two (362_agent_task_durable_work_dir -> 376)
and drop the 362 exception, so the uniqueness guard covers the whole
tree again. 362_plugin_hook_engine keeps its prefix because migrations
363-365 build on the objects it creates and must stay ordered after it.

The runner keys schema_migrations on the full stem, so any database that
already ran 362_agent_task_durable_work_dir re-runs this file under the
new stem. Its DDL is idempotent (ADD COLUMN IF NOT EXISTS / DROP COLUMN
IF EXISTS), so the replay is a no-op and the stale 362 ledger row is
inert -- the readiness check only requires every on-disk version to be
recorded, not the reverse.

Co-authored-by: Sol-Boy <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-08-20 17:31:27 +08:00

12 lines
693 B
SQL

-- Records the durable directory that replaces a disposable task worktree
-- after the daemon has confirmed that worktree was finalized and removed.
-- NULL means no such handoff was reported, so clients must keep using work_dir.
--
-- Renumbered from 362: #7176 and #7182 both took prefix 362 before either
-- merged, and neither had shipped in a release when the collision was found.
-- The runner keys schema_migrations on the full stem, so a database that
-- already ran 362_agent_task_durable_work_dir re-runs this file under the new
-- stem; the DDL is idempotent, so that replay is a no-op. Keep it that way.
ALTER TABLE agent_task_queue
ADD COLUMN IF NOT EXISTS durable_work_dir TEXT;