This project is archived and is in readonly mode.

#6644 new

Rails Generator Fails with Existing Migration

Reported by ramaboo | March 29th, 2011 @ 06:19 PM

I have a basic rails project and run a generator

$ rails g scaffold foo name:string

Pretty straight forward. I am creating a Foo model with a name field. The controller runs fine however if I run the same command again say something like this (realizing that I forgot the age field):

$ rails g scaffold foo name:string age:string

I get the following error
Another migration is already named create_foos: /var/www/

The preferred action would be some sort of Do you want to override prompt that is common on the other controller actions. If I delete the above migration file I can then run the second migration and overwrite the existing files as expected.

Add an overwrite prompt to the active_record generator.


No comments found

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket