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

feat(migrations): allow a 3rd party migrator to be configured #986

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

hamptokr
Copy link
Contributor

Thanks for the wonderful library!

I'm working on an external package that will provide a MySQL adapter for Oban (#836) and I need to be able to override the migrator used. This change will allow a migrator key in the Repo's config to allow for that:

config :oban_mysql, ObanMySQL.Test.MySQLRepo,
  priv: "test/support/mysql",
  url: System.get_env("DATABASE_URL") || "mysql://root@localhost/oban_mysql_test",
  migrator: ObanMySQL.Migrations.MySQL,
  pool: Ecto.Adapters.SQL.Sandbox

If you have a different name suggestion or have a different approach in mind, please let me know! 🙂

The very very WIP repo is over here: https://github.com/hamptokr/oban_mysql
With this change I was able to get the migrations running and the migration tests passing. I'm just starting to port over the engine and its test suite.

lib/oban/migration.ex Outdated Show resolved Hide resolved
@sorentwo sorentwo merged commit 4ecb070 into oban-bg:main Nov 15, 2023
2 checks passed
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