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

Feature request: abiliy to use both .sql and .rs migrations #154

Closed
Jackneill opened this issue Mar 4, 2021 · 5 comments · Fixed by #170
Closed

Feature request: abiliy to use both .sql and .rs migrations #154

Jackneill opened this issue Mar 4, 2021 · 5 comments · Fixed by #170
Labels
enhancement New feature or request

Comments

@Jackneill
Copy link

Jackneill commented Mar 4, 2021

Example usage could be:
src/store/migrations/mod.rs:

use refinery::{
    embed_migrations,
    include_migration_mods,
};

embed_migrations!(".");
include_migration_mods!(".");

//or something like:
//hybrid_migrations!(".");
$ ls src/store/migrations
mod.rs
V1__init.rs
V2__update.sql
...
@jxs jxs added the enhancement New feature or request label Mar 4, 2021
@ruseinov
Copy link

ruseinov commented May 5, 2021

@jxs any idea how to approach this?

@jxs
Copy link
Member

jxs commented May 11, 2021

Hi, maybe we could have a hybrid_migrations! macro that calls the other two and merges the list returned by each, wdyt?

@ruseinov
Copy link

@jxs only makes sense if we check that the mixed migrations follow the sequential versioning pattern I guess

@omid
Copy link
Contributor

omid commented Aug 30, 2021

I don't have deep knowledge of refinery, but...

Why do we need 3 different macros? I think one is enough.
We can crawl the directory, interpret files, based on extension do #ident::migration() or include_str!(#path).to_string().

wdyt?

@omid
Copy link
Contributor

omid commented Aug 30, 2021

OK, please check my PR #170.

@jxs jxs closed this as completed in #170 Sep 5, 2021
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

Successfully merging a pull request may close this issue.

4 participants