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:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user