From 69c7468f88921d3a113b1504ea89ff09144a6161 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Wed, 31 Dec 2025 18:05:33 -0400 Subject: [PATCH 1/2] Add missing database schema for email feeds and RSS processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two production errors occurred because code was merged without corresponding migrations: 1. perspectives.body column - createEmailPerspective() in industry-feeds-db.ts references this column (added in 158c48ea) but migration was missing 2. addie_knowledge.source_url unique index - createOrUpdateRssKnowledge() in content-curator.ts uses ON CONFLICT (source_url) (added in 45450b23) but the constraint wasn't created This adds migration 068 with both schema changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../db/migrations/068_add_perspectives_body.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 server/src/db/migrations/068_add_perspectives_body.sql diff --git a/server/src/db/migrations/068_add_perspectives_body.sql b/server/src/db/migrations/068_add_perspectives_body.sql new file mode 100644 index 0000000000..c86c4c8db0 --- /dev/null +++ b/server/src/db/migrations/068_add_perspectives_body.sql @@ -0,0 +1,14 @@ +-- Migration: 068_add_perspectives_body.sql +-- Add body column for storing raw email content from newsletter subscriptions +-- This is separate from 'content' (markdown for articles) to preserve original email HTML/text + +ALTER TABLE perspectives + ADD COLUMN IF NOT EXISTS body TEXT; + +COMMENT ON COLUMN perspectives.body IS 'Raw email body content for newsletter-sourced perspectives (HTML or plain text)'; + +-- Add unique constraint on addie_knowledge.source_url for ON CONFLICT upserts +-- Used by createOrUpdateRssKnowledge in content-curator.ts +CREATE UNIQUE INDEX IF NOT EXISTS idx_addie_knowledge_source_url_unique + ON addie_knowledge(source_url) + WHERE source_url IS NOT NULL; From c5395f9f14ffc0f3dd1b0243edf5d76f7fb40bc5 Mon Sep 17 00:00:00 2001 From: Brian O'Kelley Date: Wed, 31 Dec 2025 18:07:59 -0400 Subject: [PATCH 2/2] Add changeset --- .changeset/fix-perspectives-body.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-perspectives-body.md diff --git a/.changeset/fix-perspectives-body.md b/.changeset/fix-perspectives-body.md new file mode 100644 index 0000000000..43458c31e8 --- /dev/null +++ b/.changeset/fix-perspectives-body.md @@ -0,0 +1,5 @@ +--- +"adcontextprotocol": patch +--- + +Add missing database migrations for email feeds and RSS processing