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)
This commit is contained in:
Claude
2026-04-10 20:19:49 +00:00
parent b8ed2095ba
commit be2f5eb5a5

View File

@@ -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