find migrations dir in debug mode using CARGO_MANIFEST_DIR variable instead of current working directory

This commit is contained in:
Dull Bananas 2024-12-19 16:15:28 -07:00
parent f044ef3321
commit 7308dc8632

View file

@ -39,7 +39,9 @@ fn migrations() -> diesel_migrations::EmbeddedMigrations {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
#[expect(clippy::expect_used)] #[expect(clippy::expect_used)]
fn migrations() -> diesel_migrations::FileBasedMigrations { fn migrations() -> diesel_migrations::FileBasedMigrations {
diesel_migrations::FileBasedMigrations::find_migrations_directory() diesel_migrations::FileBasedMigrations::find_migrations_directory_in_path(env!(
"CARGO_MANIFEST_DIR"
))
.expect("failed to get migration source") .expect("failed to get migration source")
} }