I'm a fairly new developer. I created a project in rails to learn
with, and created a model for 'computer'. I edited the appropriate
001_create_computer.rb migration file, and as part of it, included a
t.column :cost, :decimal
Later, learning more about rails, I went back and changed the line to
look like this:
t.column :cost, :decimal, :precision => 8, :scale => 2, :default => 0
What I can't figure out is, what do I do to rebuild the database?
rake db:migrate seems to ignore the old 001 file. I assume I need to
do something like rake db:rebuild, to go back and start from scratch
and apply all the migration scripts, but I can't find the appropriate
command. If anyone knows what step or steps I need to take, I would
greatly appreciate it.
Also, is this the proper way to make such a change? I think I could
add another migration file, 005-blah-blah.rb, and change the column
there, but I see no value in keeping the original column declaration
since it is essentially incomplete. Thank you for your advice!