aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-02-15 08:24:41 -0500
committerwangjohn <wangjohn@mit.edu>2013-02-15 08:29:16 -0500
commitb4c99ea0a4d7e5223fa1b21cdb9301f9d090dbfe (patch)
treee497d908022c734af8c6bbdec63815f38df64eb5 /railties
parent9d023c87de98f8c85574ecec019dd30a3dfc6f03 (diff)
downloadrails-b4c99ea0a4d7e5223fa1b21cdb9301f9d090dbfe.tar.gz
rails-b4c99ea0a4d7e5223fa1b21cdb9301f9d090dbfe.tar.bz2
rails-b4c99ea0a4d7e5223fa1b21cdb9301f9d090dbfe.zip
Added extra comment when a migration already exists of the same name.
User should know that he can overwrite the previous migration. This comes in handy especially when generating models which were previously created then removed.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/migration.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/migration.rb b/railties/lib/rails/generators/migration.rb
index 5bf98bb6e0..cd69a017dd 100644
--- a/railties/lib/rails/generators/migration.rb
+++ b/railties/lib/rails/generators/migration.rb
@@ -52,7 +52,7 @@ module Rails
if destination && options.force?
remove_file(destination)
elsif destination
- raise Error, "Another migration is already named #{@migration_file_name}: #{destination}"
+ raise Error, "Another migration is already named #{@migration_file_name}: #{destination}. Use --force to remove the old migration file and replace it."
end
destination = File.join(migration_dir, "#{@migration_number}_#{@migration_file_name}.rb")
end