Reputation: 15986
I generated a scaffold with a flat model named Brick, then I created 2 new models named concrete and mortar and added has_one relationship to Brick.
Now I want to regenerate the scaffold, but I get this error:
Another migration is already named create_brick_items: Construction/db/migrate/20121210193959_create_brick_items.rb
Upvotes: 0
Views: 1008
Reputation: 111
To your question how to regenerate scaffold. You need to:
rake db:rollback
or if you dint need your data you can drop database and then create new databaserails destroy scaffold Brick
rails generate scaffold Bricks name:string mortar:references
Upvotes: 1
Reputation: 26169
rails generate migration AddMortarToBrick mortar:references
or what ever brick has one of
Upvotes: 1