-
Hello, I'm encountering an issue when using the pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("../../migrations");
My workspace structure looks like this:
How can I ensure that the Thanks in advance for any help or suggestions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I can reproduce this, but I fear there is not much we as diesel team can do to resolve this. It seem more like an issue with your code structure. The underlying problem is that if you provide an explicit relative path to the migrations directory like that the proc macro will resolve that directory starting from the crate root. Now cargo publish copies everything (according to the include/exclude rules in your |
Beta Was this translation helpful? Give feedback.
I can reproduce this, but I fear there is not much we as diesel team can do to resolve this. It seem more like an issue with your code structure.
The underlying problem is that if you provide an explicit relative path to the migrations directory like that the proc macro will resolve that directory starting from the crate root. Now cargo publish copies everything (according to the include/exclude rules in your
Cargo.toml
file) in your crate root (everything incrates/migrate
in the case of the migrate crate) into thetarget/package
and tries to build it from there. That then fails as the relative path to the migration directory is now not correct anymore as the migration directory is outside…