From 2952040f7079669e6a55e7ffab167c2c7ff99afe Mon Sep 17 00:00:00 2001 From: Christopher Wade Date: Sat, 30 Apr 2011 00:48:06 -0500 Subject: [PATCH] Sort migrations by the migration ID. --- activerecord/lib/active_record/railties/databases.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index c6bc040f9f..a71bffd580 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -210,10 +210,10 @@ db_namespace = namespace :db do puts "\ndatabase: #{config['database']}\n\n" puts "#{'Status'.center(8)} #{'Migration ID'.ljust(14)} Migration Name" puts "-" * 50 - file_list.each do |file| + file_list.sort_by {|file| file[1]}.each do |file| puts "#{file[0].center(8)} #{file[1].ljust(14)} #{file[2].humanize}" end - db_list.each do |version| + db_list.sort.each do |version| puts "#{'up'.center(8)} #{version.ljust(14)} *** NO FILE ***" end puts