A user reported that their weekly content plan could only post to one of their three Instagram accounts. I assumed a misconfiguration. It wasn't one. The planner selected a platform and then one account inside it, so "Instagram" resolved to exactly one Instagram account. The other two were unreachable and no setting could change it.
Fixing it meant making the account the unit of targeting instead of the platform. Straightforward enough.
The interesting decision was the second feature that came with it: letting several same-platform accounts share one generation, so one post body publishes to all of them.
There were two places to model that. The obvious one was the per-account assignment table, which is where a plan records "this account gets a post at this time." But that table has a required single-account foreign key, a uniqueness constraint on account plus plan plus time, and 19 consumers. Widening it to many-accounts meant touching all of them and relaxing a constraint that was doing real work.
The other option was a nullable group column on the channel row: channels in the same group generate together. The scheduled-post record downstream was already multi-account, because publishing the same post to several accounts has been supported for a long time. The capability existed, it just wasn't reachable from the planner.
Modeling it on the channel meant one migration, one nullable column, and no change to the assignment table at all.
So before widening a model to fit a new feature, check whether some other model in the system is already the right shape. Multi-account publishing was already solved one layer down. The planner just needed a way to say "these go together."
One detail that fell out of the design: a group needs a single posting schedule, so the lowest account id in the group leads and the others follow its slots. Deterministic, no new column, and if that account disconnects the next one takes over.
Top comments (0)