lib/tasks/sequel/rollback_archived_migrations.rake in umbrellio-sequel-plugins-0.14.0.189 vs lib/tasks/sequel/rollback_archived_migrations.rake in umbrellio-sequel-plugins-0.14.0.192

- old
+ new

@@ -18,10 +18,10 @@ applied_migrations = migrator.applied_migrations.map(&:to_i) filesystem_migrations = Rails.root.glob("db/migrate/*.rb").map { |x| File.basename(x).to_i } missing_migrations = applied_migrations - filesystem_migrations if missing_migrations.any? - missing_migrations.each do |migration| + missing_migrations.sort.reverse_each do |migration| DB.log_info("Rolling back migration #{migration}...") migrator.undo(migration) end else DB.log_info("No migrations found")