SR041

Severity: error

Summary: soft_delete declared but schema has no deleted_at field

What this means

An endpoint declares soft_delete: true but the resource schema has no deleted_at field. Soft deletes work by setting deleted_at to the current timestamp instead of removing the row. The schema must declare this field explicitly.

Example that triggers this

endpoints:
  delete:
    auth: [admin]
    soft_delete: true

(without deleted_at in schema:)

How to fix it

Add deleted_at as a nullable timestamp field to the schema:

deleted_at: { type: timestamp, nullable: true }

Back to top

Shaperail documentation lives in the same repository as the framework so every release has versioned instructions. See the latest release for the most recent version.

This site uses Just the Docs, a documentation theme for Jekyll.