feat: with single migrations
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-04-05 22:55:07 +02:00
parent 924bcf8c8c
commit c3f9613541
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394

View File

@ -29,14 +29,12 @@ impl CuddleFileExt for RustService {
if let Some(components) = &cuddle_file.components { if let Some(components) = &cuddle_file.components {
s = if let Some(database) = &components.database { s = if let Some(database) = &components.database {
match database { match database {
CuddleDatabase::Enabled(true) => s.with_sqlx().with_sqlx_migrations( CuddleDatabase::Enabled(true) => s.with_sqlx_migrations(
PathBuf::from("crates") PathBuf::from("crates")
.join(&cuddle_file.vars.service) .join(&cuddle_file.vars.service)
.join("migrations/crdb"), .join("migrations/crdb"),
), ),
CuddleDatabase::Values { migrations } => { CuddleDatabase::Values { migrations } => s.with_sqlx_migrations(migrations),
s.with_sqlx().with_sqlx_migrations(migrations)
}
CuddleDatabase::Enabled(false) | CuddleDatabase::Default {} => s, CuddleDatabase::Enabled(false) | CuddleDatabase::Default {} => s,
} }
} else { } else {