Follow-up from "Rollback to a safer place to stop"
The following discussion from !15465 (merged) should be addressed:
-
@stanhu started a discussion: (+2 comments) Could we just run a script that calculates the right step value with something like this?
target_migration = '20170523121229' regexp = %r(^([0-9]*)_.*) migrations = Dir.entries('db/migrate').select { |x| x =~ regexp }.map { |x| x.gsub(regexp, '\1') }.compact.sort.reverse! puts migrations.find_index(target_migration)