File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -137,14 +137,14 @@ if [ ! -z "$migrations" ]; then
137137    fi 
138138
139139    #  BUILD THE MIGRATION COMMAND FROM THE VERSION AND TYPE
140-     version=` echo " $migration " |  cut -d' _' |  cut -d' /' ` 
140+     version=` echo " $migration " |  grep -o  ' db/migrate/.* '   |   cut -d' _' |  cut -d' /' ` 
141141    migrate_command=" ActiveRecord::Migrator.run(:$migration_type , 'db/migrate', $version ) rescue nil" 
142142
143143    #  APPEND OR PREPREND TO THE COMMAND LIST DEPENDING ON MIGRATION TYPE
144144    if  [[ $migration_type  ==  " down" ;  then 
145145      #  CHECKOUT DOWN MIGRATION AND SAVE PATH FOR CLEANUP
146-       git checkout " $old_ref " " $migration " 
147-       migration_cleanup=" $migration_cleanup  $migration " 
146+       git checkout " $old_ref " " :/ $migration " 
147+       migration_cleanup=" $migration_cleanup  $(  git ls-files :/ $ migration) " 
148148      migrate_commands=" $migrate_command ;$migrate_commands " 
149149    else 
150150      migrate_commands=" $migrate_commands ;$migrate_command " 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments