Skip to content

Conversation

@DanRibbens
Copy link
Contributor

Description

This change makes it so that you can pass the req around inside your migrate up and down functions rather than having to manually manage transactions manually inside the migration.

This was implemented by changing the following:

  • Initialize transactions on a req object and pass it through to up and down
  • Use the payload transaction methods rather than the db adapter transaction calls directly, this makes it more stable if an adapter doesn't implement the transaction functions.
  • mongodb and postgres specific migrations updated to have req

Unrelated change:

  • Removes the rest endpoints for payload-migjrations which weren't meant to be exposed.

  • I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • Existing test suite passes locally with my changes
  • I have made corresponding changes to the documentation
@jmikrut jmikrut merged commit 22f4967 into main Jan 9, 2024
@jmikrut jmikrut deleted the feat/migration-transactions branch January 9, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants