From b4c99ea0a4d7e5223fa1b21cdb9301f9d090dbfe Mon Sep 17 00:00:00 2001 From: wangjohn Date: Fri, 15 Feb 2013 08:24:41 -0500 Subject: 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. --- railties/lib/rails/generators/migration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3