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