magpie/app/db/migrations/018_campaign_subs_max_posts.sql
pyr0ball a2620570fa feat(dupe-guard): add max_posts per-sub cap to prevent one-shot intro campaigns from re-posting
Adds max_posts INTEGER to campaign_subs (NULL = unlimited/evergreen).
Adds successful_post_count() query counting lifetime success records.
poster.py checks max_posts before the 7-day rolling dupe guard.

Root cause: campaign 2 fired 8 days after the last post (just outside the
7-day window), allowing a duplicate r/opensource pitch. Fix: set max_posts=1
on intro campaigns so the lifetime cap fires regardless of window.
2026-05-06 08:52:21 -07:00

2 lines
157 B
SQL

-- Add per-sub post cap; NULL = unlimited (evergreen). Set max_posts=1 for one-shot intro campaigns.
ALTER TABLE campaign_subs ADD COLUMN max_posts INTEGER;