Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions diesel_migrations/migrations_macros/src/embed_migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ pub fn derive_embed_migrations(input: &syn::DeriveInput) -> quote::Tokens {
fn revert(&self, _conn: &SimpleConnection) -> Result<(), RunMigrationsError> {
unreachable!()
}

fn file_path(&self) -> Option<&Path> {
Some(Path::new(self.version))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of returning a fake path here, we should fix the formatting to just print the version if the path is not set.

}
}
);

Expand All @@ -69,6 +73,7 @@ pub fn derive_embed_migrations(input: &syn::DeriveInput) -> quote::Tokens {
use self::diesel_migrations::*;
use self::diesel::connection::SimpleConnection;
use std::io;
use std::path::Path;

const ALL_MIGRATIONS: &[&Migration] = &[#(#migrations_expr),*];

Expand Down