Re: [Rails] A Question about Model and Database?
use def change
forget up and down def
cheers
Fahim Babar Patel
-- On Sat, Sep 8, 2012 at 9:55 AM, Javier Quarite <jquarites@gmail.com> wrote:
Rails is smart enough to determine if you want to create or drop a table if you have done the migration with changedef change#code hereendit only depends on how you write the commandsif you dorake db:migratethen it will create the db (if the code inside change is about it) and if you dorake db:rollbackit will drop that tablein other case thendef up#create table hereenddef down#drop table hereendtake a look hereand then herethere is a lot more on googleJavierQ--
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.
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