From 494a1a2fa4c03d6e99877bdac20be645559ca518 Mon Sep 17 00:00:00 2001 From: Peter Amiri Date: Mon, 5 Oct 2026 18:19:55 -0700 Subject: [PATCH] docs: softDelete=false alone purges already soft-deleted rows Since #4397 (#4371), includeSoftDeletes=true is no longer needed to remove rows that are already soft-deleted. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Peter Amiri --- cli/lucli/templates/app/.ai/models.md | 2 +- docs/consumer-ai/.ai/models.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/lucli/templates/app/.ai/models.md b/cli/lucli/templates/app/.ai/models.md index f8dd795907..b39a9f0b61 100644 --- a/cli/lucli/templates/app/.ai/models.md +++ b/cli/lucli/templates/app/.ai/models.md @@ -107,7 +107,7 @@ A model whose table has a `deletedAt` column soft-deletes. `t.timestamps()` adds - `delete()`, `deleteAll()`, `deleteOne()` and `deleteByKey()` run `UPDATE ... SET deletedAt = ` instead of `DELETE`. The timestamp follows `timeStampMode` (UTC by default). `beforeDelete` / `afterDelete` still run. - Finders skip soft-deleted rows: `findAll`, `findOne`, `findByKey`, `findEach`, `findInBatches`, paginated `findAll(page=)`, `count` / `sum` / `average` / `minimum` / `maximum`, `exists`, association readers (`post.comments()`), `updateAll` / `updateOne` / `updateByKey`, and the query builder. Soft-deleted rows on an `include=` join are filtered too. - Pass `includeSoftDeletes=true` to see them: `model("Post").findAll(where="authorId = 7", includeSoftDeletes=true)`. -- Remove a row for good with `softDelete=false`. For rows that are already soft-deleted, pass both: `model("Post").deleteAll(where="...", softDelete=false, includeSoftDeletes=true)`. +- Remove a row for good with `softDelete=false`; that also removes rows that are already soft-deleted: `model("Post").deleteAll(where="...", softDelete=false)`. - Restore: `model("Post").updateByKey(key=params.key, deletedAt="", includeSoftDeletes=true)`. - `validatesUniquenessOf` ignores soft-deleted rows, but a database unique index does not: a new row can pass validation and still hit the index. diff --git a/docs/consumer-ai/.ai/models.md b/docs/consumer-ai/.ai/models.md index f8dd795907..b39a9f0b61 100644 --- a/docs/consumer-ai/.ai/models.md +++ b/docs/consumer-ai/.ai/models.md @@ -107,7 +107,7 @@ A model whose table has a `deletedAt` column soft-deletes. `t.timestamps()` adds - `delete()`, `deleteAll()`, `deleteOne()` and `deleteByKey()` run `UPDATE ... SET deletedAt = ` instead of `DELETE`. The timestamp follows `timeStampMode` (UTC by default). `beforeDelete` / `afterDelete` still run. - Finders skip soft-deleted rows: `findAll`, `findOne`, `findByKey`, `findEach`, `findInBatches`, paginated `findAll(page=)`, `count` / `sum` / `average` / `minimum` / `maximum`, `exists`, association readers (`post.comments()`), `updateAll` / `updateOne` / `updateByKey`, and the query builder. Soft-deleted rows on an `include=` join are filtered too. - Pass `includeSoftDeletes=true` to see them: `model("Post").findAll(where="authorId = 7", includeSoftDeletes=true)`. -- Remove a row for good with `softDelete=false`. For rows that are already soft-deleted, pass both: `model("Post").deleteAll(where="...", softDelete=false, includeSoftDeletes=true)`. +- Remove a row for good with `softDelete=false`; that also removes rows that are already soft-deleted: `model("Post").deleteAll(where="...", softDelete=false)`. - Restore: `model("Post").updateByKey(key=params.key, deletedAt="", includeSoftDeletes=true)`. - `validatesUniquenessOf` ignores soft-deleted rows, but a database unique index does not: a new row can pass validation and still hit the index.