fix(drizzle): ensure updateOne does not create new document if where query has no results (#12991)

Previously, `db.updateOne` calls with `where` queries that lead to no
results would create new rows on drizzle. Essentially, `db.updateOne`
behaved like `db.upsertOne` on drizzle
This commit is contained in:
Alessio Gravili
2025-07-02 13:56:59 -07:00
committed by GitHub
parent babcd599da
commit fafaa04e1a
8 changed files with 102 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ import {
updateMany,
updateOne,
updateVersion,
upsert,
} from '@payloadcms/drizzle'
import {
columnToCodeConverter,
@@ -207,7 +208,7 @@ export function postgresAdapter(args: Args): DatabaseAdapterObj<PostgresAdapter>
updateMany,
updateOne,
updateVersion,
upsert: updateOne,
upsert,
})
}