>From my research, it appears that I have to manually create databasetables. I was wondering if there is a gem or something else in ROR that would auto-create the database for me based upon my ruby model. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
augustlilleaas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-22 02:31 UTC
Re: Auto-generate database schema based upon model?
The fields themselves won''t be auto created, but when you do ./script/generate model model_name, you''ll also get a db migration file generated for ya. On Jan 19, 10:56 pm, "rhodebump" <p...-URWvmY1Kg72WkzVdRvz7FA@public.gmane.org> wrote:> >From my research, it appears that I have to manually create databasetables. I was wondering if there is a gem or something else in ROR > that would auto-create the database for me based upon my ruby model. > > Thanks.--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You have to manually create the empty db yourself (eg mysqladmin create foo_development) When you generate the model an empty migration is created in db\migrate. Edit this to define the table columns and then run rake db:migrate. Read about migrations, much nicer than hand coding sql scripts. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---