Skip to content

Commit

Permalink
fix wrong injection in migration/lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
kaplanelad committed Oct 28, 2024
1 parent 43ef503 commit 64fdfce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion loco-gen/src/templates/model.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ skip_glob: "migration/src/*_{{plural_snake}}.rs"
message: "Migration for `{{name}}` added! You can now apply it with `$ cargo loco db migrate`."
injections:
- into: "migration/src/lib.rs"
after: "inject-below"
before_last: "\\]"
content: " Box::new({{module_name}}::Migration),"
- into: "migration/src/lib.rs"
before: "pub struct Migrator"
Expand Down
5 changes: 4 additions & 1 deletion starters/rest-api/migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![Box::new(m20220101_000001_users::Migration)]
vec![
//
Box::new(m20220101_000001_users::Migration),
]
}
}
5 changes: 4 additions & 1 deletion starters/saas/migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pub struct Migrator;
#[async_trait::async_trait]
impl MigratorTrait for Migrator {
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
vec![Box::new(m20220101_000001_users::Migration)]
vec![
//
Box::new(m20220101_000001_users::Migration),
]
}
}

0 comments on commit 64fdfce

Please sign in to comment.