↓ Skip to main content

“The biggest reason for this is that almost always, data deletion also has non-data side effects.”

brandur.org ↗

A deleted_at column is a promise that every query, forever, remembers to filter on it. One forgets and you leak deleted data. Foreign keys stop protecting you, and the undelete button almost never gets used because the emails and charges already went out. Move dead rows to their own table and stop pretending a flag is a safety net.