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

@@ -38,6 +38,7 @@ import {
updateMany,
updateOne,
updateVersion,
upsert,
} from '@payloadcms/drizzle'
import {
columnToCodeConverter,
@@ -202,7 +203,7 @@ export function vercelPostgresAdapter(args: Args = {}): DatabaseAdapterObj<Verce
updateMany,
updateOne,
updateVersion,
upsert: updateOne,
upsert,
})
}