Swap executor config for executor

This commit is contained in:
Louis Knight-Webb
2025-06-16 20:34:56 -04:00
parent aeee2c8941
commit 73af2b6fd9
2 changed files with 33 additions and 19 deletions

View File

@@ -0,0 +1,18 @@
-- Change executor_config column to executor (string) in task_attempts table
-- Add the new executor column
ALTER TABLE task_attempts ADD COLUMN executor TEXT;
-- Convert existing executor_config data to executor names
-- This assumes the existing JSONB data has a structure we can extract from
UPDATE task_attempts
SET executor = CASE
WHEN executor_config IS NULL THEN NULL
WHEN executor_config->>'type' = 'Echo' THEN 'echo'
WHEN executor_config->>'type' = 'Claude' THEN 'claude'
ELSE 'echo' -- Default fallback
END
WHERE executor_config IS NOT NULL;
-- Drop the old executor_config column
ALTER TABLE task_attempts DROP COLUMN executor_config;