Commit Graph

1 Commits (dev)

Author SHA1 Message Date
Your Name 2cc3c9b84b Make reply_count increment NULL-safe and drop schema migration
Replace the atomic increment in CommentPipeline and StatusReplyPipeline
with a NULL-safe update using COALESCE(reply_count, 0) + 1, so a parent
whose reply_count is NULL (freshly composed or historical) advances to 1
on its first reply instead of staying stuck at NULL.

This removes the need for the schema/backfill migration, which is dropped
here; the model attribute default of 0 still covers newly created posts,
and historical NULL rows are repaired lazily on their next reply.

Add ReplyCountNullIncrementTest covering both reply pipelines against a
parent forced to NULL (bypassing the factory default that masked the bug)
and asserting new Status posts persist 0.
1 month ago