From a9b19f649ff91e73ff5b66787c0f0f5652744685 Mon Sep 17 00:00:00 2001 From: Bruce MacKenzie Date: Wed, 10 Aug 2022 23:38:04 -0400 Subject: [PATCH] update Delete Godoc to describe soft delete behaviour (#5554) --- finisher_api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/finisher_api.go b/finisher_api.go index af9afb6361..bdf0437dc0 100644 --- a/finisher_api.go +++ b/finisher_api.go @@ -388,7 +388,9 @@ func (db *DB) UpdateColumns(values interface{}) (tx *DB) { return tx.callbacks.Update().Execute(tx) } -// Delete delete value match given conditions, if the value has primary key, then will including the primary key as condition +// Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. +// If value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current +// time if null. func (db *DB) Delete(value interface{}, conds ...interface{}) (tx *DB) { tx = db.getInstance() if len(conds) > 0 {