Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a migrator for uptrace/bun #8

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Conversation

BrynBerkeley
Copy link
Contributor

This adds a migrator for uptrace/bun. Like golangmigrator, it only supports SQL file migrations as discussed in #7 .

@peterldowns
Copy link
Owner

peterldowns commented Jun 4, 2024

This looks great! I'll give a final review within a day or two, but on first glance I think this is shippable. Can you confirm that you've used this for your migrations and it's all good?

Thanks so much for the contribution :)

@BrynBerkeley
Copy link
Contributor Author

I've tested this locally, and it works and mostly suits my needs. This migrator is a slight modification of the one I've been using for projects.

In my projects, I've needed to run go-based migrations alongside the SQL ones for some of my tests. So I allowed passing go migrations through to the migrator, but their hashes ended up being just the name of the go file. I just had to be mindful that the database template wouldn't reflect any of the changes made in the go migration, but it's a source of confusion, so I haven't included it here.

@peterldowns
Copy link
Owner

Tests and docs look great, thank you again for contributing!

@peterldowns peterldowns merged commit 5835df4 into peterldowns:main Jul 15, 2024
peterldowns added a commit that referenced this pull request Jul 15, 2024
Followup to #8, which introduced the new `bunmigrator` package.

- Updates the `bunmigrator` documentation to show how to include the
postgres driver being used in the tests.
- Moves table-initialization logic out of `bunmigrator.Prepare` and into
`bunmigrator.Migrate`. This functions the same way, and will make my
life slightly easier as I think about removing or replacing the
`Prepare` method. (I'm thinking of removing it since it's unnecessary
and unused by any of the migrators.)
- Updates the main README to mention that `bunmigrator` exists, and
thank @BrynBerkeley for contributing it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants