From be2f5eb5a518570f0d10eb94d601948ff0b1afc8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 10 Apr 2026 20:19:49 +0000 Subject: [PATCH] fix: Add platform_post_id column per Gemini review - Added platform_post_id VARCHAR(255) for Phase 2 API matching - Added composite index on (platform, platform_post_id) - Future-proofs manual entries for automatic API sync Chronicler #76 (per Gemini consultation) --- services/arbiter-3.0/migrations/108_social_analytics.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/arbiter-3.0/migrations/108_social_analytics.sql b/services/arbiter-3.0/migrations/108_social_analytics.sql index fac127c..87c1871 100644 --- a/services/arbiter-3.0/migrations/108_social_analytics.sql +++ b/services/arbiter-3.0/migrations/108_social_analytics.sql @@ -37,7 +37,10 @@ CREATE TABLE social_posts ( -- Metadata created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(), - notes TEXT + notes TEXT, + + -- Platform native ID (for Phase 2 API matching) + platform_post_id VARCHAR(255) ); -- Account-level snapshots (weekly or on-demand) @@ -65,6 +68,7 @@ CREATE TABLE social_account_snapshots ( -- Indexes for common queries CREATE INDEX idx_social_posts_platform ON social_posts(platform); CREATE INDEX idx_social_posts_posted_at ON social_posts(posted_at DESC); +CREATE INDEX idx_social_posts_platform_post_id ON social_posts(platform, platform_post_id); CREATE INDEX idx_social_snapshots_platform_date ON social_account_snapshots(platform, snapshot_date DESC); -- Comments