File tree 1 file changed +3
-3
lines changed
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
137
137
fi
138
138
139
139
# BUILD THE MIGRATION COMMAND FROM THE VERSION AND TYPE
140
- version=` echo " $migration " | cut -d' _' -f1 | cut -d' /' -f3`
140
+ version=` echo " $migration " | grep -o ' db/migrate/.* ' | cut -d' _' -f1 | cut -d' /' -f3`
141
141
migrate_command=" ActiveRecord::Migrator.run(:$migration_type , 'db/migrate', $version ) rescue nil"
142
142
143
143
# APPEND OR PREPREND TO THE COMMAND LIST DEPENDING ON MIGRATION TYPE
144
144
if [[ $migration_type == " down" ]]; then
145
145
# 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) "
148
148
migrate_commands=" $migrate_command ;$migrate_commands "
149
149
else
150
150
migrate_commands=" $migrate_commands ;$migrate_command "
You can’t perform that action at this time.
0 commit comments