From 58d41b66b09b80c8559be33d34ed58b20e982e22 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Tue, 13 Jan 2026 09:40:51 -0500 Subject: [PATCH] fix: remove insight_goal_id references after column drop Migration 166 dropped the insight_goal_id column from member_outreach but the code still referenced it, causing database errors in production outreach scheduler. Removed from: - MemberOutreach interface - CreateOutreachInput interface - recordOutreach SQL INSERT query - proactive-outreach.ts recordOutreach call Goal tracking now happens via user_goal_history table instead. Co-Authored-By: Claude Opus 4.5 --- .changeset/tender-experts-repeat.md | 4 ++++ server/src/addie/services/proactive-outreach.ts | 1 - server/src/db/insights-db.ts | 7 ++----- 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 .changeset/tender-experts-repeat.md diff --git a/.changeset/tender-experts-repeat.md b/.changeset/tender-experts-repeat.md new file mode 100644 index 0000000000..4ceb3aa470 --- /dev/null +++ b/.changeset/tender-experts-repeat.md @@ -0,0 +1,4 @@ +--- +--- + +Remove insight_goal_id references following migration 166 column drop. diff --git a/server/src/addie/services/proactive-outreach.ts b/server/src/addie/services/proactive-outreach.ts index 80319d55b2..556924b4f8 100644 --- a/server/src/addie/services/proactive-outreach.ts +++ b/server/src/addie/services/proactive-outreach.ts @@ -530,7 +530,6 @@ async function initiateOutreach(candidate: OutreachCandidate): Promise { const result = await query( `INSERT INTO member_outreach ( - slack_user_id, outreach_type, insight_goal_id, thread_id, dm_channel_id, + slack_user_id, outreach_type, thread_id, dm_channel_id, initial_message, variant_id, tone, approach - ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) + ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *`, [ input.slack_user_id, input.outreach_type, - input.insight_goal_id || null, input.thread_id || null, input.dm_channel_id || null, input.initial_message || null,