File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,13 @@ fn all_migrations() -> Vec<Box<dyn Migration>> {
7272/// Migrations are applied in order, with each migration checking if it should
7373/// be applied before making changes. The manifest file is modified in-place.
7474pub fn apply_migrations ( manifest_path : & Path ) -> Result < ( ) > {
75- step ( Step :: Load , "Apply migrations" ) ;
75+ let mut apply_printed = false ;
76+ let mut print_apply = || {
77+ if !apply_printed {
78+ step ( Step :: Generate , "Applying migrations" ) ;
79+ apply_printed = true ;
80+ }
81+ } ;
7682
7783 let source_dir = crate :: manifest:: manifest_dir ( manifest_path) ;
7884
@@ -84,16 +90,18 @@ pub fn apply_migrations(manifest_path: &Path) -> Result<()> {
8490 for migration in all_migrations ( ) {
8591 match migration. check ( & ctx) ? {
8692 MigrationCheck :: ShouldApply => {
93+ print_apply ( ) ;
8794 step (
8895 Step :: Generate ,
8996 & format ! ( "Apply migration: {}" , migration. name( ) ) ,
9097 ) ;
9198 migration. apply ( & ctx) ?;
9299 }
93100 MigrationCheck :: Skip => {
94- step ( Step :: Skip , & format ! ( "Skip migration: {}" , migration . name ( ) ) ) ;
101+ // No need to bother the user
95102 }
96103 MigrationCheck :: SkipWithReason ( reason) => {
104+ print_apply ( ) ;
97105 step (
98106 Step :: Skip ,
99107 & format ! ( "Skip migration: {} ({})" , migration. name( ) , reason) ,
You can’t perform that action at this time.
0 commit comments