Skip to content

transactionOptions not respected by migrate #4719

@ssyberg

Description

@ssyberg

Link to reproduction

No response

Describe the Bug

I think this will be a simple/quick fix, but looks lke the recent work on transactionOptions (#4599) did not propagate to the migrations command
(https://github.com/payloadcms/payload/blob/main/packages/payload/src/database/migrations/migrate.ts#L32)

Example error output with transactions off:

[22:20:47] ERROR (payload): Error running migration 20240104_185338_clear_collection_contribs err: { "type": "TypeError", "message": "this.beginTransaction is not a function", "stack": TypeError: this.beginTransaction is not a function at Object.migrate (/Users/backend/node_modules/payload/dist/database/migrations/migrate.js:35:40) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async migrate (/Users/backend/node_modules/payload/dist/bin/migrate.js:64:13) } node:internal/process/promises:289 triggerUncaughtException(err, true /* fromPromise */); ^ TypeError: this.beginTransaction is not a function 

To Reproduce

n/a

Payload Version

2.6.0

Adapters and Plugins

db-mongodb

Metadata

Metadata

Assignees

Labels

db: mongodb@payloadcms/db-mongodbstatus: needs-triagePossible bug which hasn't been reproduced yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions