File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,20 @@ fn run_migrations(
36
36
let mut migrations = Vec :: new ( ) ;
37
37
for path in migration_files_path {
38
38
let sql = std:: fs:: read_to_string ( path. as_path ( ) )
39
- . with_context ( || format ! ( "could not read migration file name {}" , path. display( ) ) ) ?;
39
+ . with_context ( || format ! ( "Could not read contents of file {}" , path. display( ) ) ) ?;
40
40
41
41
//safe to call unwrap as find_migration_filenames returns canonical paths
42
42
let filename = path
43
43
. file_name ( )
44
44
. and_then ( |file| file. to_os_string ( ) . into_string ( ) . ok ( ) )
45
45
. unwrap ( ) ;
46
46
47
- let migration = Migration :: unapplied ( & filename, & sql)
48
- . with_context ( || format ! ( "could not read migration file name {}" , path. display( ) ) ) ?;
47
+ let migration = Migration :: unapplied ( & filename, & sql) . with_context ( || {
48
+ format ! (
49
+ "Could not create new migration from contents of file {}" ,
50
+ path. display( )
51
+ )
52
+ } ) ?;
49
53
migrations. push ( migration) ;
50
54
}
51
55
let mut config = config ( config_location, env_var_opt) ?;
You can’t perform that action at this time.
0 commit comments