Fixing Production Data in Rails: Lessons from a 6,000-Row Backfill
ruby
dev.to
Fixing a bug in production is usually straightforward. But what happens when the data in the database itself is broken? That’s when things get tricky. I learned this when a routine deploy quietly broke confirmed_at on our Order records. By the time anyone noticed, around 6,000 rows were affected — and dashboards, emails, and downstream services all depended on that field. The two-line code fix shipped in minutes, but the data backfill required a lot more thought. The First Naive