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

Allow migrator to have multiple sources for migrations #3573

Closed
kirillsalykin opened this issue Oct 23, 2024 · 3 comments
Closed

Allow migrator to have multiple sources for migrations #3573

kirillsalykin opened this issue Oct 23, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@kirillsalykin
Copy link

kirillsalykin commented Oct 23, 2024

Is your feature request related to a problem? Please describe.
I've tried to use underway crate (https://github.com/maxcountryman/underway) which have its sql migrations and runs them using sqlx.
I do have my own migrations which I also run via sqlx.
Both migrators fail because it detects missing migrations - my misses underway migrations and underway migrator misses mine.

    underway::MIGRATOR.run(&pool).await.unwrap();
    sqlx::migrate!().run(&pool).await.unwrap();

Describe the solution you'd like
I'd like be able to provide multiple sources to migrator so it can run migrations from the crates w/o issues and there is no need to have ignore-missing setting.

pub async fn new<'s, S>(source: S) -> Result<Self, MigrateError>

Would be nice if a crate can expose its migrations as additional source.

Describe alternatives you've considered
Crate copies migrations into my project migrations folder.

Additional context
maxcountryman/underway#21

@abonander
Copy link
Collaborator

abonander commented Oct 23, 2024

I think multiple sources in one migrator is a huge footgun and we will never support it. This has come up before.

However, an explicit goal of #3383 is to allow relocating the migrations table and supporting multiple migrators, with the idea that each application using a database could own its own schema.

@kirillsalykin
Copy link
Author

clear, thanks for clarification.

@cboecking
Copy link

cboecking commented Oct 29, 2024

Will you kindly tag me when you need testers? Specifically for #3383

I maintain an ERP (where many 3rd parties contribute in different ways). I need each party to be able to contribute independently. I would love to apply my scenarios to this feature.

Chuck B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants