However, the following command

>   script/generate migration add_email_to_user email:string

would have generated the appropriate migration file using the hints in
the migration name to generate the correct table and column names.



On Oct 8, 2:51 pm, "JAMES MASON" <[EMAIL PROTECTED]> wrote:
> > script/generate migration AddEmailField email:string
>
> cannot possibly create the migration you show.
>
> The next step (this is in lab 5522) is "3. Modify the newly created
> migration file as shown below."
>
> James Mason
> Systems Administrator/Safety & Environmental Director
> Yamato Engine Specialists
> 360-306-5017
>
>
>
> On Tue, Sep 9, 2008 at 9:53 AM, alibaba82 <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> > I am a newbie so anyones help is appreciated.
>
> > I notice that in a few lessons (example 3.3 --> Add email field to the
> > users table)
> > we just create a migration with these args 'AddEmailField
> > email:string'
>
> > This migrations generates this ruby code
> > class AddEmailField < ActiveRecord::Migration
> >  def self.up
> >    add_column :users, :email, :string
> >  end
>
> >  def self.down
> >    remove_column :users, :email
> >  end
> > end
>
> > My questions is how does the migration know what model to use. How did
> > ':users' magically appear in add_column :users, :email, :string
>
> > Thanks
>
> > Ali
>
> Confidentiality Notice:
> The documents accompanying this electronic transmission may contain 
> confidential information. The information is intended only for the use of the 
> individual(s) or entity named above. If you are not the intended recipient, 
> you are notified that any disclosure, copying, distribution or taking of any 
> action in reliance on the contents of this electronic information is not 
> permissible. If you have received this electronic document in error, please 
> immediately notify us by telephone at (360)733-1916.
> Thank you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to