SKILL-081 Data modeling and migrations Locked skill

Soft deletes and restore

A soft delete is just a hidden row — if your default queries don't exclude it, you've built a bug, not a feature.

01

What this skill helps you build

Archive rows instead of destroying them with a deleted_at timestamp, hide them from normal queries by default, and support restore plus an eventual hard purge.

The production takeaway

A soft delete is just a hidden row — if your default queries don't exclude it, you've built a bug, not a feature.

02

Inside this skill

The full skill expands these implementation areas with decisions, edge cases, prompts, tests, and framework-specific code.

Data modeling and migrations
What this helps you build

A reversible delete : when a user "deletes" something, you mark it as gone rather than erasing it. The row keeps existing with a deleted at timestamp, it disappears from every norm

🔒
Data modeling and migrations
When to use this

Use soft deletes when losing data is expensive, embarrassing, or illegal to recover from. Concretely, reach for this when you have: User facing "delete" that should be undoable a t

🔒
Data modeling and migrations
The core idea

Don't DELETE . Add a nullable deleted at timestamp and stamp it instead. A row is "alive" when deleted at IS NULL and "deleted" when it holds a time. The whole pattern rests on one

🔒
03

Unlock the full implementation

Paid access includes the complete skill body, implementation prompt, common mistakes, production checklist, and code examples where this skill includes them.