Re: [Rails] A Question about Model and Database?
Rails is smart enough to determine if you want to create or drop a table if you have done the migration with change
def change
#code here
end
it only depends on how you write the commands
if you do
rake db:migrate
then it will create the db (if the code inside change is about it) and if you do
rake db:rollback
it will drop that table
in other case then
def up
#create table here
end
def down
#drop table here
end
take a look here
and then here
there is a lot more on google
JavierQ
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home