-- First, create a temporary column
ALTER TABLE test_runs ADD COLUMN application_ids_new jsonb NOT NULL DEFAULT '[]'::jsonb;

-- Copy data from old column to new column
UPDATE test_runs SET application_ids_new = application_ids::jsonb;

-- Drop the old column
ALTER TABLE test_runs DROP COLUMN application_ids;

-- Rename the new column to the original name
ALTER TABLE test_runs RENAME COLUMN application_ids_new TO application_ids; 